[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.3.9 TTF_FontFaceIsFixedWidth

int TTF_FontFaceIsFixedWidth(TTF_Font *font)

The loaded font to get the fixed width status of.

Test if the current font face of the loaded font is a fixed width font. Fixed width fonts are monospace, meaning every character that exists in the font is the same width, thus you can assume that a rendered string's width is going to be the result of a simple calculation:
glyph_width * string_length
NOTE: Passing a NULL font into this function will cause a segfault.

Returns: >0 if font is a fixed width font. 0 if not a fixed width font.

// get the loaded font's face fixed status
//TTF_Font *font;

    printf("The font is fixed width.\n");
    printf("The font is not fixed width.\n");

See Also:
3.3.8 TTF_FontFaces,
3.3.10 TTF_FontFaceFamilyName,
3.3.11 TTF_FontFaceStyleName,
3.3.12 TTF_GlyphMetrics

This document was generated on January, 14 2006 using texi2html