1 #ifndef _SDLWRAP_FONT_H_
2 #define _SDLWRAP_FONT_H_
5 #include "SDL/SDL_ttf.h"
7 #include "ErrorHandler.hpp"
13 /* This exception is thrown when a font could not be loaded for some reason, either because it wasn't a font or
14 * the path to the TTF file is invalid. It is also thrown in the case that the TTF system could not be loaded.
18 /* Typical constructor that opens a TTF font file using TTFFilePath and sets it to render at size FontSize.
19 * Throws a TTFError in case the TTF system could not be loaded (Only happens when the first font is loaded or
20 * if you try to load a font when the TTF system is not running, more generally as you can call Shutdown() then
21 * load a font. Also keeps a refcount using FontCount.
23 Font(const std::string TTFFilePath
, const int FontSize
);
25 /* Just frees the memory used by the Font and decrements FontCount. */
28 /* In case you want to shutdown the TTF system, just call this. It will only shutdown if there are no fonts in
29 * memory, which it checks by comparing FontCount.
31 static void Shutdown();
34 TTF_Font
*me
; // Publicize it so FontSurface can use it in it's rendering schemes.