Retrieve 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.
The style as a bitmask composed of the following masks:
If no style is set then TTF_STYLE_NORMAL is returned.
Binds to C-function in SDL_ttf.h
int TTF_GetFontStyle(TTF_Font *font)
NOTE: Passing a NULL font into this function will cause a segfault.
// get the loaded font's style //TTF_Font *font; int style; style=TTF_GetFontStyle(font); printf("The font style is:"); if(style==TTF_STYLE_NORMAL) printf(" normal"); else { if(style&TTF_STYLE_BOLD) printf(" bold"); if(style&TTF_STYLE_ITALIC) printf(" italic"); if(style&TTF_STYLE_UNDERLINE) printf(" underline"); } printf("\n");
SdlTtf Class | Tao.Sdl Namespace | TTF_SetFontStyle