.\" Automatically generated by Pandoc 2.2.1 .\" .TH "ALLEGRO_GLYPH" "3alleg5" "" "Allegro reference manual" "" .hy .SH NAME .PP ALLEGRO_GLYPH \- Allegro 5 API .SH SYNOPSIS .IP .nf \f[C] #include\ typedef\ struct\ ALLEGRO_GLYPH\ ALLEGRO_GLYPH; \f[] .fi .SH DESCRIPTION .PP A structure containing the properties of a character in a font. .IP .nf \f[C] typedef\ struct\ ALLEGRO_GLYPH\ { \ \ \ ALLEGRO_BITMAP\ *bitmap;\ \ \ //\ the\ bitmap\ the\ character\ is\ on \ \ \ int\ x;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ the\ x\ position\ of\ the\ glyph\ on\ bitmap \ \ \ int\ y;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ the\ y\ position\ of\ the\ glyph\ on\ bitmap \ \ \ int\ w;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ the\ width\ of\ the\ glyph\ in\ pixels \ \ \ int\ h;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ the\ height\ of\ the\ glyph\ in\ pixels \ \ \ int\ kerning;\ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ pixels\ of\ kerning\ (see\ below) \ \ \ int\ offset_x;\ \ \ \ \ \ \ \ \ \ \ \ \ //\ x\ offset\ to\ draw\ the\ glyph\ at \ \ \ int\ offset_y;\ \ \ \ \ \ \ \ \ \ \ \ \ //\ y\ offset\ to\ draw\ the\ glyph\ at \ \ \ int\ advance;\ \ \ \ \ \ \ \ \ \ \ \ \ \ //\ number\ of\ pixels\ to\ advance\ after\ this\ character }\ ALLEGRO_GLYPH; \f[] .fi .PP bitmap may be a sub\-bitmap in the case of color fonts. Bitmap can also be NULL in which case nothing should be drawn (sometimes true for whitespace characters in TTF fonts). .PP kerning should be added to the x position you draw to if you want your text kerned and depends on which codepoints al_get_glyph(3alleg5) was called with. .PP Glyphs are tightly packed onto the bitmap, so you need to add offset_x and offset_y to your draw position for the text to look right. .PP advance is the number of pixels to add to your x position to advance to the next character in a string and includes kerning. .SH SINCE .PP 5.2.1 .RS .PP \f[I][Unstable API]:\f[] This API is new and subject to refinement. .RE .SH SEE ALSO .PP al_get_glyph(3alleg5)