NewAPI/Text
From Allegro Wiki
< NewAPI
This article is a stub. Please help Allegro by expanding it.
Just creating a stub page.. but eventually we will need a text API.
Likely it should be mostly the same as the A4 one.
Contents |
Structures
ALLEGRO_FONT
Internally, this will have a vtable, and font-driver-specific data. E.g. A Freetype driver probably will wrap around Freetype's structures. If it's targetting OpenGL, likely it also has a texture cache and stuff like that.
A bitmap-font driver just will have a big list of bitmaps.
struct ALLEGRO_FONT
Font loading
al_load_font
ALLEGRO_FONT *al_load_font(char const *filename, float size, int flags);
Not really sure yet what is needed..
Text output
void al_draw_text(ALLEGRO_FONT *font, int x, int y, int flags, ALLEGRO_COLOR *color, char const *text);
void al_printf(ALLEGRO_FONT *font, int x, int y, int flags, ALLEGRO_COLOR *color, char const *format, ...);
- Parameter order needs to be fixed yet.
- Maybe the font to use should be a state?
