![]() |
nomlib
|
Pure abstract interface for a font resource. More...
#include <IFont.hpp>
Public Types | |
| enum | FontType { NotDefined = 0 , BitmapFont , TrueTypeFont , BMFont } |
| typedef IFont | self_type |
| typedef self_type * | raw_ptr |
| typedef std::shared_ptr< self_type > | shared_ptr |
| typedef std::unique_ptr< self_type > | unique_ptr |
Public Member Functions | |
| virtual IFont::raw_ptr | clone (void) const =0 |
| virtual bool | valid (void) const =0 |
| virtual const Image * | image (uint32) const =0 |
| virtual enum IFont::FontType | type (void) const =0 |
| virtual const Glyph & | glyph (uint32, uint32) const =0 |
| virtual int | newline (uint32) const =0 |
| virtual sint | spacing (uint32) const =0 |
| virtual int | kerning (uint32, uint32, uint32) const =0 |
| virtual int | hinting (void) const =0 |
| virtual uint32 | font_style (void) const =0 |
| virtual const FontMetrics & | metrics (void) const =0 |
| virtual bool | set_point_size (int)=0 |
| virtual bool | set_hinting (int)=0 |
| virtual bool | set_outline (int)=0 |
| virtual void | set_font_style (uint32 style)=0 |
| virtual void | set_font_kerning (bool state)=0 |
| virtual bool | load (const std::string &filename)=0 |
Pure abstract interface for a font resource.
/
nomlib's built-in font classes all derive from this pure abstract class. nom::Text focuses solely on text rendering, utilizing this common interface defined here.
In short: a font resource class is responsible for computing available glyphs (including their bounds, sizes, etc.) and most importantly, a complete cache of usable glyph bitmaps laid out in a texture atlas (in no particular packing order). nom::Text uses the font's texture atlas in addition to the font's glyph metrics (the bounds being most critical for rendering from this atlas to the screen).
See the source files of nom::BitmapFont for a complete example of how to write a custom font resource class that is suitable for nom::Text to render from. Supporting data structures include: nom::FontMetrics, nom::FontPage, nom::FontRow, nom::Glyph and so on.
Reference: ASCII Table
|
pure virtual |
Implemented in nom::BitmapFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, nom::BMFont, and nom::TrueTypeFont.
|
pure virtual |
Implemented in nom::BitmapFont, and nom::TrueTypeFont.