Tao.Sdl SDK Documentation

SdlTtf.TTF_GetFontStyle Method 

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.

[Visual Basic]
Public Shared Function TTF_GetFontStyle( _
   ByVal font As IntPtr _
) As Integer
[C#]
public static int TTF_GetFontStyle(
   IntPtr font
);

Parameters

font
The loaded font to get the style of

Return Value

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)
            

Remarks

Get the rendering style of the loaded font.

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

Example

            // 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

SdlTtf Class | Tao.Sdl Namespace | TTF_SetFontStyle