SDL_ttf

SDL_ttf > Functions > Management

TTF_OpenFont

TTF_Font *TTF_OpenFont(const char *file, int ptsize)

file

ptsize

Load file for use as a font, at ptsize size. This is actually TTF_OpenFontIndex(file, ptsize, 0). This can load TTF and FON files.

Returns: a pointer to the font as a TTF_Font. NULL is returned on errors.

// load font.ttf at size 16 into font
TTF_Font *font;
font=TTF_OpenFont("font.ttf", 16);
if(!font) {
    printf("TTF_OpenFont: %s\n", TTF_GetError());
    // handle error
}

See Also

TTF_OpenFontIndex, TTF_OpenFontRW, TTF_CloseFont

SDL_ttf_kopie/Functions/Management/TTF_OpenFont (last edited 2009-02-25 23:12:01 by sign-4d0949c8)