SDL_ttf

SDL_ttf > Functions > Attributes

TTF_GetFontStyle

int TTF_GetFontStyle(TTF_Font *font)

font

Get the rendering style of the loaded font.

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

Returns: The style as a bitmask composed of the following masks:
TTF_STYLE_BOLD
TTF_STYLE_ITALIC
TTF_STYLE_UNDERLINE
If no style is set then TTF_STYLE_NORMAL is returned.

// 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");

See Also

TTF_SetFontStyle, 5. Defines

SDL_ttf_kopie/Functions/Attributes/TTF_GetFontStyle (last edited 2009-02-25 23:12:02 by sign-4d0949c8)