![]() |
Jopnal Engine
alpha 0.4
Simple Component Based 2D/3D Game Engine
|
#include <Font.hpp>
Public Member Functions | |
| Font (const std::string &name) | |
| Constructor. More... | |
| ~Font () override | |
| Destructor. More... | |
| bool | load (const std::string &path, const int fontSize) |
| Load from file. More... | |
| bool | load (const void *ptr, const uint32 size, const int fontSize) |
| Loads a font from memory. More... | |
| float | getKerning (const uint32 left, const uint32 right) const |
| Returns the necessary kerning advancement between two characters. More... | |
| const Glyph & | getGlyph (const uint32 codepoint) const |
| Returns a single glyph from given codepoint. More... | |
| float | getLineSpacing () const |
| Return the spacing between two rows in the font. More... | |
| const Texture2D & | getTexture () const |
| Return the texture that contains all loaded glyphs. More... | |
| int | getSize () const |
| Returns pixel size of the font. More... | |
Public Member Functions inherited from jop::Resource | |
| Resource (const std::string &name) | |
| Constructor. More... | |
| virtual | ~Resource ()=0 |
| Virtual destructor. More... | |
| const std::string & | getName () const |
| Get the name of this resource. More... | |
| void | setPersistence (const unsigned short level) |
| Set the persistence level. More... | |
| unsigned short | getPersistence () const |
| Get the persistence level. More... | |
Public Member Functions inherited from jop::SafeReferenceable< Resource > | |
| WeakReference< Resource > | getReference () const |
| Get a weak reference to the bound object. More... | |
Public Member Functions inherited from jop::SerializeInfo | |
| SerializeInfo () | |
| void | setSerializePackage (const uint16 package) |
| uint16 | getSerializePackage () const |
| void | setShouldSerialize (const bool set) |
| bool | shouldSerialize () const |
| void | setLightSerializeable (const bool set) |
| bool | isLightSerializeable () const |
Static Public Member Functions | |
| static Font & | getDefault () |
| Get the default font. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from jop::Resource | |
| Resource (const Resource &other, const std::string &newName) | |
| Copy constructor. More... | |
Protected Member Functions inherited from jop::SafeReferenceable< Resource > | |
| SafeReferenceable (Resource *ref) | |
| Constructor. More... | |
| SafeReferenceable (SafeReferenceable< Resource > &&other) | |
| Move constructor. More... | |
| SafeReferenceable & | operator= (SafeReferenceable< Resource > &&other) |
| Move assignment operator. More... | |
| ~SafeReferenceable () | |
| Protected destructor. More... | |
Font manager class, which loads fonts from file and packs them to textures. Supports .ttf format.
| jop::Font::Font | ( | const std::string & | name | ) |
Constructor.
| name | Name of the resource |
|
override |
Destructor.
|
static |
Get the default font.
Returns a single glyph from given codepoint.
If glyph with the given codepoint does not exist yet calls packGlyph() to create and pack it.
| codepoint | Unicode codepoint of a character |
Returns the necessary kerning advancement between two characters.
| left | Code point value pointing to the desired character |
| right | Code point value pointing to the next character |
| float jop::Font::getLineSpacing | ( | ) | const |
Return the spacing between two rows in the font.
| int jop::Font::getSize | ( | ) | const |
Returns pixel size of the font.
| const Texture2D& jop::Font::getTexture | ( | ) | const |
Return the texture that contains all loaded glyphs.
| bool jop::Font::load | ( | const std::string & | path, |
| const int | fontSize | ||
| ) |
Load from file.
| path | Path to desired .ttf font file |
| fontSize | Glyph size in texture |
| bool jop::Font::load | ( | const void * | ptr, |
| const uint32 | size, | ||
| const int | fontSize | ||
| ) |
Loads a font from memory.
The memory will be copied.
| ptr | Pointer to memory |
| size | Amount of bytes to read |
| fontSize | Glyph size in texture |
1.8.11