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

3.3.2 TTF_GetFontStyle

int TTF_GetFontStyle(TTF_Font *font)

font
The loaded font to get the style of.

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
TTF_STYLE_STRIKETHROUGH
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");
    if(style&TTF_STYLE_STRIKETHROUGH)
        printf(" strikethrough");
}
printf("\n");

See Also:
3.3.3 TTF_SetFontStyle,
5. Defines



This document was generated on November, 13 2009 using texi2html