1ALLEGRO_GLYPH(3) ALLEGRO_GLYPH(3)
2
3
4
6 ALLEGRO_GLYPH - Allegro 5 API
7
9 #include <allegro5/allegro_font.h>
10
11 typedef struct ALLEGRO_GLYPH ALLEGRO_GLYPH;
12
14 A structure containing the properties of a character in a font.
15
16 typedef struct ALLEGRO_GLYPH {
17 ALLEGRO_BITMAP *bitmap; // the bitmap the character is on
18 int x; // the x position of the glyph on bitmap
19 int y; // the y position of the glyph on bitmap
20 int w; // the width of the glyph in pixels
21 int h; // the height of the glyph in pixels
22 int kerning; // pixels of kerning (see below)
23 int offset_x; // x offset to draw the glyph at
24 int offset_y; // y offset to draw the glyph at
25 int advance; // number of pixels to advance after this character
26 } ALLEGRO_GLYPH;
27
28 bitmap may be a sub-bitmap in the case of color fonts. Bitmap can also
29 be NULL in which case nothing should be drawn (sometimes true for
30 whitespace characters in TTF fonts).
31
32 kerning should be added to the x position you draw to if you want your
33 text kerned and depends on which codepoints al_get_glyph(3) was called
34 with.
35
36 Glyphs are tightly packed onto the bitmap, so you need to add offset_x
37 and offset_y to your draw position for the text to look right.
38
39 advance is the number of pixels to add to your x position to advance to
40 the next character in a string and includes kerning.
41
43 5.2.1
44
45 [Unstable API]: This API is new and subject to refinement.
46
48 al_get_glyph(3)
49
50
51
52Allegro reference manual ALLEGRO_GLYPH(3)