![]() |
nomlib
|
Font interface wrapper for nom::IFont derived objects. More...
#include <Font.hpp>
Public Types | |
| typedef Font | self_type |
| typedef IFont | font_type |
Public Member Functions | |
| Font () | |
| Default constructor; initialize the font to NULL and the sharable state to false. | |
| ~Font () | |
| Destructor. | |
| Font (const std::shared_ptr< font_type > &font) | |
| Constructor for initializing an object from a std::shared_ptr object<nom::IFont> object. | |
| Font (font_type *font) | |
| Constructor for initializing an object from a nom::IFont derived raw pointer. | |
| font_type * | operator-> () const |
| Read-write pointer operator overload. | |
| bool | operator== (const self_type &rhs) const |
| Equality comparison overload. | |
| bool | operator!= (const self_type &rhs) const |
| In-equality comparison overload. | |
| bool | unique () const |
| Get the object's unique state. | |
| IFont::FontType | type (const std::string &filename) const |
| Determine the type of font by filename extension. | |
| bool | load (const std::string &filename) |
| Load a font from a filename. | |
Private Attributes | |
| std::shared_ptr< Font::font_type > | font_ |
Font interface wrapper for nom::IFont derived objects.
A class wrapper interface for a nom::IFont derived objects. This wrapper has the side intention of being conveniently used within a nom::ResourceCache (it does not support pure abstract objects, such as nom::IFont).
| bool nom::Font::load | ( | const std::string & | filename | ) |
Load a font from a filename.
| bool nom::Font::operator!= | ( | const self_type & | rhs | ) | const |
In-equality comparison overload.
| font_type * nom::Font::operator-> | ( | ) | const |
Read-write pointer operator overload.
| bool nom::Font::operator== | ( | const self_type & | rhs | ) | const |
Equality comparison overload.
| IFont::FontType nom::Font::type | ( | const std::string & | filename | ) | const |
Determine the type of font by filename extension.
| filename | The file name (absolute or relative) with the full extension. File extensions recognized are 'png', 'bmp', 'ttf', 'ttc' 'otf', 'ttf' and 'fnt'. |
| bool nom::Font::unique | ( | ) | const |
Get the object's unique state.