Open a font file and create a font of the specified point size. Some .fon fonts will have several sizes embedded in the file, so the point size becomes the index of choosing which size. If the value is too high, the last indexed size will be the default.
a pointer to the font as a TTF_Font. NULL is returned on errors.
Binds to C-function in SDL_ttf.h
TTF_Font *TTF_OpenFont(const char *file, int ptsize)
// 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 }
SdlTtf Class | Tao.Sdl Namespace | TTF_OpenFontIndex | TTF_OpenFontRW | TTF_CloseFont