[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
void TTF_SetFontStyle(TTF_Font *font, int style)
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: TTF_STYLE_UNDERLINE may cause surfaces created by TTF_RenderGlyph_*
functions to be extended vertically, downward only, to encompass the underline if the original glyph metrics didn't allow for the underline to be drawn below. This does not change the math used to place a glyph using glyph metrics.
On the other hand TTF_STYLE_STRIKETHROUGH doesn't extend the glyph, since this would invalidate the metrics used to position the glyph when blitting, because they would likely be extended vertically upward. There is perhaps a workaround, but it would require programs to be smarter about glyph blitting math than they are currently designed for.
Still, sometimes the underline or strikethrough may be outside of the generated surface, and thus not visible when blitted to the screen. In this case, you should probably turn off these styles and draw your own strikethroughs and underlines.
|
See Also:
3.3.2 TTF_GetFontStyle,
5. Defines
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |