|
|
Font addonsal_destroy_fontFrees the memory being used by a font structure. This is now wholly handled in the vtable. al_grab_font_from_bitmapWork horse for grabbing a font from an Allegro bitmap. Parameters:
Examples: The first example will grab glyphs for the 95 standard printable ASCII characters, beginning with the space character (32) and ending with the tilde character (126). The second example will map the first 96 glyphs found in the bitmap to ASCII range, the next 95 glyphs to Latin 1, the next 128 glyphs to Extended-A, and the last glyph to the Euro character. (This is just the characters found in the Allegro 4 font.) al_init_font_addonal_shutdown_font_addonShut down the font addon. This is done automatically at program exit, but can be called any time the user wishes as well. al_load_bitmap_fontal_load_fontLoads a font from disk. al_load_bitmap_fontImport routine for the Allegro bitmap font format. al_register_font_loaderInforms Allegro of a new font file type, telling it how to load files of this format. The extension should include the leading dot ('.') character. It will be matched case-insensitively. The Returns true on success, false on error. Returns false if unregistering an entry that doesn't exist. al_get_font_line_heightReturns the height of a character in the specified font. al_get_text_widthCalculates the length of a string in a particular font. See also: al_get_ustr_width al_get_ustr_widthCalculates the length of a string in a particular font. See also: al_get_text_width al_draw_textWrites the 0-terminated string The
al_draw_ustrLike al_draw_text, except the text is passed as an ALLEGRO_USTR instead of a 0-terminated char array. al_draw_justified_textLike al_draw_text, but justifies the string to the specified area. al_draw_justified_ustral_draw_textfFormatted text output, using a printf() style format string, all parameters have the same meaning as with al_draw_text otherwise. al_draw_justified_textfLike al_draw_justified_text and al_draw_textf. al_get_text_dimensionsSometimes, the al_get_text_width and al_get_font_line_height functions are not enough for exact text placement, so this function returns some additional information. Returned variables (all in pixel):
If the X is the position you specify to draw text, the meaning of ascent and descent and the line height is like in the figure below. Note that glyphs may go to the left and upwards of the X, in which case x and y will have negative values. al_get_ustr_dimensionsal_load_ttf_fontLoads 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 only flag supported right now is:
al_init_ttf_addonCall this after al_init_font_addon to make al_load_font recognize .ttf and other formats supported by al_load_ttf_font. |
Last updated: 2009-08-09 08:22:34 UTC