Represents a font or true-type font.
More...
#include <Font.h>
|
| | Font () |
| |
| virtual | ~Font () |
| |
| virtual bool | Load (const std::string &path, ResourceManager *pManager) |
| | Load the desired font into memory.
|
| |
| virtual int | GetLineHeight () const |
| | Gets the line height of the font in pixels.
|
| |
| virtual int | GetTextWidth (const char *text) const |
| | Gets the width in pixels of the specified string.
|
| |
| virtual bool | IsCloneable () const |
| | Used to determine if the font is cloneable.
|
| |
| virtual ALLEGRO_FONT * | GetAllegroFont () const |
| | Get the allegro font representation of the texture.
|
| |
| virtual | ~Resource () |
| |
| unsigned short | GetResourceID () const |
| | Gets the ID of the resource.
|
| |
|
| static void | SetLoadSize (const int size, const bool restore=false) |
| | Specifies the size of the font when loaded.
|
| |
| static void | SetCharacterRange (const int rangeCount, int ranges[]) |
| | Sets which characters to use when using a bitmap as a font.
|
| |
|
| void | Split (const std::string &line, const char delimeter, std::vector< std::string > &elements) |
| | Splits a string into a vector of strings.
|
| |
| void | ParseComments (std::string &line) |
| | Removes c-style, single-line comments from a line of text.
|
| |
| void | TrimLine (std::string &line) |
| | Removes white-space at the front and end of a line of text.
|
| |
| ResourceManager * | GetResourceManager () |
| | Gets a pointer to the ResourceManager that was used to load the resource.
|
| |
| virtual Resource * | Clone () |
| | Clones a resource.
|
| |
Represents a font or true-type font.
Definition at line 20 of file Font.h.
◆ Font()
| KatanaEngine::Font::Font |
( |
| ) |
|
|
inline |
◆ ~Font()
| virtual KatanaEngine::Font::~Font |
( |
| ) |
|
|
inlinevirtual |
◆ GetAllegroFont()
| virtual ALLEGRO_FONT * KatanaEngine::Font::GetAllegroFont |
( |
| ) |
const |
|
inlinevirtual |
Get the allegro font representation of the texture.
- Returns
- Returns the underlaying allegro font.
Definition at line 62 of file Font.h.
◆ GetLineHeight()
| virtual int KatanaEngine::Font::GetLineHeight |
( |
| ) |
const |
|
inlinevirtual |
Gets the line height of the font in pixels.
- Returns
- Returns the line height in pixels.
Definition at line 48 of file Font.h.
◆ GetTextWidth()
| virtual int KatanaEngine::Font::GetTextWidth |
( |
const char * | text | ) |
const |
|
inlinevirtual |
Gets the width in pixels of the specified string.
- Parameters
-
| text | The string to measure. |
- Returns
- Returns the width in pixels.
Definition at line 53 of file Font.h.
◆ IsCloneable()
| virtual bool KatanaEngine::Font::IsCloneable |
( |
| ) |
const |
|
inlinevirtual |
Used to determine if the font is cloneable.
- Returns
- Returns true if the font is clonable, false otherwise.
Implements KatanaEngine::Resource.
Definition at line 58 of file Font.h.
◆ Load()
| bool KatanaEngine::Font::Load |
( |
const std::string & | path, |
|
|
ResourceManager * | pManager ) |
|
virtual |
Load the desired font into memory.
- Parameters
-
| path | The path to the desired font. |
| pManager | A pointer to the ResourceManager that will manage the font. |
- Returns
- Returns true if the font was loaded, false otherwise.
Implements KatanaEngine::Resource.
Definition at line 39 of file Font.cpp.
◆ SetCharacterRange()
| void KatanaEngine::Font::SetCharacterRange |
( |
const int | rangeCount, |
|
|
int | ranges[] ) |
|
static |
Sets which characters to use when using a bitmap as a font.
- Parameters
-
| rangeCount | The length of the ranges array. |
| ranges | The character ranges. |
Definition at line 33 of file Font.cpp.
◆ SetLoadSize()
| void KatanaEngine::Font::SetLoadSize |
( |
const int | size, |
|
|
const bool | restore = false ) |
|
static |
Specifies the size of the font when loaded.
- Parameters
-
| size | The desired size of the font. |
| restore | To determine if the load size should revert back to previous after the next font is loaded. |
Definition at line 26 of file Font.cpp.
The documentation for this class was generated from the following files: