Set the font style This font style is implemented by modifying the font glyphs, and doesn't reflect any inherent properties of the truetype font file.
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...
Binds to C-function in SDL_ttf.h
void TTF_SetFontStyle(TTF_Font *font, int style)
// set the loaded font's style to bold italics //TTF_Font *font; TTF_SetFontStyle(font, TTF_STYLE_BOLD|TTF_STYLE_ITALIC); // render some text in bold italics... // set the loaded font's style back to normal TTF_SetFontStyle(font, TTF_STYLE_NORMAL);
SdlTtf Class | Tao.Sdl Namespace | TTF_GetFontStyle