al_load_ttf_font
ALLEGRO_FONT *al_load_ttf_font(char const *filename, int size, int flags)
Introduced in 5.0.0
Loads a TrueType font from a file using the FreeType library. Quoting from the FreeType FAQ this means support for many different font formats:
TrueType, OpenType, Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others
The size parameter determines the size the font will be rendered at, specified in pixel. The standard font size is measured in units per EM, if you instead want to specify the size as the total height of glyphs in pixel, pass it as a negative value.
Note: If you want to display text at multiple sizes, load the font multiple times with different size parameters.
The following flags are supported:
- ALLEGRO_TTF_NO_KERNING - Do not use any kerning even if the font file supports it.
- ALLEGRO_TTF_MONOCHROME - Load as a monochrome font (Which means no anti-aliasing of the font is done)
See also: al_init_ttf_addon, al_load_ttf_font_f
Examples: ex_synth
Most helpful discussions:
- MOUSE question
- Mouse Activity Question
- Is using TTFs really that complicated?
- My second game, space invader simplified
- I'm new
- Difficulty compiling on Windows
- Screen is cleared and a new one appears Allegro5 in C?
- Game Crashing and I'm not sure why?
- letters are rendered in their seperated form, this may require glyph hook maybe?
- still al_draw_text() problem
Other recent discussions:
- al_draw_text problem
- [A5] How to optimize al_draw_textf
- Quick Question about MSAA
- Need help with structs
- Getting parameter problems.
- BITMAP quality gets reduced
- Pixel shader- how do I get the source coordinate?
- Creating executable files in Visual Studio
- First person camera using transformations
- Audio seems overly complicated :(