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

3.3.7 TTF_SetFontHinting

void TTF_SetFontHinting(TTF_Font *font, int hinting)

The loaded font to set the outline size of.
The hinting setting desired, which is one of:
The default is TTF_HINTING_NORMAL.

Set the hinting of the loaded font. You should experiment with this setting if you know which font you are using beforehand, especially when using smaller sized fonts. If the user is selecting a font, you may wish to let them select the hinting mode for that font as well.

NOTE: Passing a NULL font into this function will cause a segfault.

NOTE: This will flush the internal cache of previously rendered glyphs, even if there is no change in hinting, so it may be best to check the current hinting by using TTF_GetFontHinting first.

// set the loaded font's hinting to optimized for monochrome rendering
//TTF_Font *font;
TTF_SetFontHinting(font, TTF_HINTING_MONO);

// render some monochrome text...

// set the loaded font's hinting back to normal
TTF_SetFontHinting(font, TTF_HINTING_NORMAL);

See Also:
3.3.6 TTF_GetFontHinting,
5. Defines,
see section Hinting,
Font Hinting @ Wikipedia,
FreeType Hinting and Bitmap rendering,
FreeType Hinting Modes

This document was generated on November, 13 2009 using texi2html