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

3.3.15 TTF_FontFaceIsFixedWidth

int TTF_FontFaceIsFixedWidth(const TTF_Font *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;

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

See Also:
3.3.14 TTF_FontFaces,
3.3.16 TTF_FontFaceFamilyName,
3.3.17 TTF_FontFaceStyleName,
3.3.19 TTF_GlyphMetrics



This document was generated on November, 13 2009 using texi2html