|
blip
0.1
|
A TrueType font. More...
#include <Font.hpp>
Public Member Functions | |
| ~Font () | |
| Destructor. More... | |
| const char * | getName () const |
| Get the font name. More... | |
| int | getSize () const |
| Get the font point size. More... | |
| int | getStyle () const |
| Get the font style. More... | |
| bool | isBold () const |
| Test if the font has a bold style. More... | |
| bool | isItalic () const |
| Test if the font has an italic style. More... | |
| int | getGlyphCount () const |
| Get the number of glyphs in the font. More... | |
| const FontGlyph * | getGlyph (char16_t c) const |
| Get the glyph for the given Unicode character. More... | |
| const FontGlyph * | getGlyph (char c) const |
| Get the glyph for the given ASCII character. More... | |
| const FontGlyph * | getGlyph (int c) const |
| Get the glyph for the given Unicode character. More... | |
| int | getAscent () const |
| Get the font's ascent, in pixels. More... | |
| int | getDescent () const |
| Get the font's descent, in pixels. More... | |
| int | getHeight () const |
| Get the font's height, in pixels. More... | |
| int | getMaxAdvance () const |
| Get the font's maximum advance, in pixels. More... | |
| const Size & | getBoundingBox () const |
| Get the font's global (maximum) glyph bounding box, in pixels. More... | |
Static Public Attributes | |
| static const int | PLAIN = 0 |
| Style constant indicating plain font. More... | |
| static const int | BOLD = 1 << 0 |
| Style constant indicating bold font. More... | |
| static const int | ITALIC = 1 << 1 |
| Style constant indicating italic font. More... | |
A TrueType font.
The class exposes the metadata for the font, such as its name, style, and metrics, and maintains a cache of character glyphs.
| ~Font | ( | ) |
Destructor.
|
inline |
Get the font's ascent, in pixels.
|
inline |
Get the font's global (maximum) glyph bounding box, in pixels.
|
inline |
Get the font's descent, in pixels.
| const FontGlyph * getGlyph | ( | char16_t | c | ) | const |
Get the glyph for the given Unicode character.
| c | The character. |
|
inline |
Get the glyph for the given ASCII character.
| c | The character. |
|
inline |
Get the glyph for the given Unicode character.
| c | The character. |
| int getGlyphCount | ( | ) | const |
Get the number of glyphs in the font.
|
inline |
Get the font's height, in pixels.
|
inline |
Get the font's maximum advance, in pixels.
| const char * getName | ( | ) | const |
Get the font name.
|
inline |
Get the font point size.
| int getStyle | ( | ) | const |
Get the font style.
The style is either Font::PLAIN, or a bitwise-or of the constants Font::BOLD and Font::ITALIC.
| bool isBold | ( | ) | const |
Test if the font has a bold style.
| bool isItalic | ( | ) | const |
Test if the font has an italic style.
|
static |
Style constant indicating bold font.
|
static |
Style constant indicating italic font.
|
static |
Style constant indicating plain font.