![]() |
nomlib
|
Bitmap font interface implementing most of the BMFont text/ascii file spec. More...
#include <BMFont.hpp>
Public Types | |
| typedef BMFont | self_type |
| Public Types inherited from nom::IFont | |
| 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 | |
| BMFont () | |
| Default constructor. | |
| virtual | ~BMFont () |
| Destructor. | |
| IFont * | clone () const override |
| bool | valid () const override |
| IFont::FontType | type () const override |
| const Image * | image (uint32 character_size) const override |
| const Glyph & | glyph (uint32 codepoint, uint32 character_size) const override |
| int | spacing (uint32 character_size) const override |
| int | kerning (uint32 first_char, uint32 second_char, uint32 character_size) const override |
| Obtain the kerning pair offsets between two glyphs. | |
| int | hinting () const override |
| uint32 | font_style () const override |
| const Size2i & | page_size (uint32 page) const |
| int | newline (uint32 character_size) const override |
| const FontMetrics & | metrics () const override |
| int | point_size () const |
| bool | use_kerning () const |
| bool | set_point_size (int) override |
| bool | set_hinting (int) override |
| bool | set_outline (int) override |
| void | set_font_style (uint32) override |
| void | set_font_kerning (bool state) override |
| Set the use of kerning for the font. | |
| bool | load (const std::string &filename) override |
| bool | parse_ascii_file (std::istream &fp) |
| Read an input source that conforms to the BMFont file spec. | |
Private Member Functions | |
| bool | build (uint32 character_size) |
| Create the texture atlas from the parsed font metrics. | |
| void | parse_string (const std::string &key, std::string &value) |
Private Attributes | |
| Size2i | page_size_ |
| The total dimensions – width and height in integer pixels – of the texture atlas used to hold the glyphs. | |
| FontMetrics | metrics_ |
| The glyph characteristics for the font in use. | |
| GlyphPage | pages_ |
| int | point_size_ |
| The point size of the font. | |
| BMFontPage | page_ |
| std::vector< BMFontKerningPair > | kernings_ |
| Kerning pairs. | |
| bool | use_kerning_ |
| Usage state of kerning pair offsets. | |
Bitmap font interface implementing most of the BMFont text/ascii file spec.
The following fields are not implemented from the info tag: 'bold', 'italic', 'charset', 'unicode', 'stretchH', 'smooth', 'aa', 'padding', 'spacing', 'outline'.
The following fields are not implemented from the common tag: 'packed', 'alphaChnl', 'redChnl', 'greenChnl', 'blueChnl'.
The following fields are not implemented from the char tag: 'page', 'chnl'.
Only one glyph page is supported. String sequences with spaces are not supported.
Software this interface has been tested with includes:
Definition at line 80 of file BMFont.hpp.
| typedef BMFont nom::BMFont::self_type |
Definition at line 83 of file BMFont.hpp.
|
private |
Create the texture atlas from the parsed font metrics.
| character_size | Not implemented. |
|
overridevirtual |
Implements nom::IFont.
|
overridevirtual |
Implements nom::IFont.
|
overridevirtual |
| codepoint | The char identifier (an ASCII value) to lookup. |
| character_size | Not implemented. |
Implements nom::IFont.
|
overridevirtual |
Implements nom::IFont.
|
overridevirtual |
| character_size | Not implemented. |
Implements nom::IFont.
|
overridevirtual |
Obtain the kerning pair offsets between two glyphs.
| character_size | Not implemented. |
Implements nom::IFont.
|
overridevirtual |
Implements nom::IFont.
|
overridevirtual |
Implements nom::IFont.
|
overridevirtual |
| character_size | Not implemented. |
Implements nom::IFont.
| const Size2i & nom::BMFont::page_size | ( | uint32 | page | ) | const |
| character_size | Not implemented. |
| bool nom::BMFont::parse_ascii_file | ( | std::istream & | fp | ) |
Read an input source that conforms to the BMFont file spec.
|
private |
|
overridevirtual |
|
overridevirtual |
Implements nom::IFont.
|
overridevirtual |
Implements nom::IFont.
|
overridevirtual |
Implements nom::IFont.
|
overridevirtual |
Implements nom::IFont.
|
overridevirtual |
| character_size | Not implemented. |
Implements nom::IFont.
|
overridevirtual |
Implements nom::IFont.
|
overridevirtual |
Implements nom::IFont.
|
private |
Kerning pairs.
Definition at line 198 of file BMFont.hpp.
|
private |
The glyph characteristics for the font in use.
Definition at line 181 of file BMFont.hpp.
|
private |
Definition at line 195 of file BMFont.hpp.
|
private |
The total dimensions – width and height in integer pixels – of the texture atlas used to hold the glyphs.
Definition at line 174 of file BMFont.hpp.
|
mutableprivate |
Definition at line 188 of file BMFont.hpp.
|
private |
The point size of the font.
Definition at line 193 of file BMFont.hpp.
|
private |
Usage state of kerning pair offsets.
Definition at line 201 of file BMFont.hpp.