SDL_ttf

SDL_ttf > Functions > Management

TTF_OpenFontIndex

TTF_Font *TTF_OpenFontIndex(const char *file, int ptsize, long index)

file

ptsize

index

Load file, face index, for use as a font, at ptsize size. This is actually TTF_OpenFontIndexRW(SDL_RWFromFile(file), ptsize, index), but checks that the RWops it creates is not NULL. 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, face 0, at size 16 into font
TTF_Font *font;
font=TTF_OpenFontIndex("font.ttf", 16, 0);
if(!font) {
    printf("TTF_OpenFontIndex: %s\n", TTF_GetError());
    // handle error
}

See Also

TTF_OpenFontIndexRW, TTF_OpenFont, TTF_CloseFont

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