Open a font file suing RWOps 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.
NOTE: src is not checked for NULL, so be careful.
Binds to C-function in SDL_ttf.h
TTF_Font *TTF_OpenFontRW(SDL_RWops *src, int freesrc, int ptsize)
// load font.ttf at size 16 into font TTF_Font *font; font=TTF_OpenFontRW(SDL_RWFromFile("font.ttf"), 1, 16); if(!font) { printf("TTF_OpenFontRW: %s\n", TTF_GetError()); // handle error }
SdlTtf Class | Tao.Sdl Namespace | TTF_OpenFontIndexRW | TTF_OpenFont | TTF_CloseFont