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

3.3.3 TTF_SetFontStyle

void TTF_SetFontStyle(TTF_Font *font, int style)

The loaded font to set the style of.
A bitmask of the desired style composed from the TTF_STYLE_* defined values.

Set the rendering style of the loaded font.

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 style, so it may be best to check the current style using TTF_GetFontStyle first.

NOTE: I've seen that combining TTF_STYLE_UNDERLINE with anything can cause a segfault, other combinations may also do this. Some brave soul may find the cause of this and fix it...

// set the loaded font's style to bold italics
//TTF_Font *font;

// render some text in bold italics...

// set the loaded font's style back to normal
TTF_SetFontStyle(font, TTF_STYLE_NORMAL);

See Also:
3.3.2 TTF_GetFontStyle,
5. Defines

This document was generated on January, 14 2006 using texi2html