26 virtual ~Font() { al_destroy_font(m_pFont); }
32 static void SetLoadSize(
const int size,
const bool restore =
false);
48 virtual int GetLineHeight()
const {
return al_get_font_line_height(m_pFont); }
53 virtual int GetTextWidth(
const char *text)
const {
return al_get_text_width(m_pFont, text); }
67 static int s_fontSize;
68 static int s_restoreSize;
70 static bool s_alAddonInitialized;
72 static int s_rangeCount;
75 ALLEGRO_FONT *m_pFont =
nullptr;
Represents a font or true-type font.
virtual int GetTextWidth(const char *text) const
Gets the width in pixels of the specified string.
static void SetCharacterRange(const int rangeCount, int ranges[])
Sets which characters to use when using a bitmap as a font.
static void SetLoadSize(const int size, const bool restore=false)
Specifies the size of the font when loaded.
virtual ALLEGRO_FONT * GetAllegroFont() const
Get the allegro font representation of the texture.
virtual bool IsCloneable() const
Used to determine if the font is cloneable.
virtual int GetLineHeight() const
Gets the line height of the font in pixels.
virtual bool Load(const std::string &path, ResourceManager *pManager)
Load the desired font into memory.
Base class for all resource types to be managed by the ResourceManager class.
Loads and manages the lifespan of objects from external files.
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...