Abstract base class for fonts.
More...
#include <font.hpp>
Abstract base class for fonts.
- See also
- type::font_metrics
-
type::glyph_metrics
-
type::bitmap_font
Definition at line 36 of file font.hpp.
◆ font() [1/2]
Creates a font and sets its metrics.
- Parameters
-
metrics | Metrics describing the font. |
Definition at line 24 of file font.cpp.
◆ font() [2/2]
Creates an empty font.
Definition at line 28 of file font.cpp.
◆ ~font()
Destroys a font.
Definition at line 31 of file font.cpp.
◆ contains()
virtual bool type::font::contains |
( |
char32_t |
code | ) |
const |
|
pure virtual |
Returns true
if the font contains a glyph with the given character code.
- Parameters
-
code | UTF-32 character code of a glyph. |
- Returns
true
if the font contains the glyph, false
otherwise.
Implemented in type::bitmap_font.
◆ get_font_metrics()
Returns metrics describing the font.
Definition at line 109 of file font.hpp.
◆ get_glyph_metrics()
virtual const glyph_metrics& type::font::get_glyph_metrics |
( |
char32_t |
code | ) |
const |
|
pure virtual |
Returns metrics describing a glyph.
- Parameters
-
code | UTF-32 character code of a glyph. |
- Returns
- Metrics describing the glyph.
Implemented in type::bitmap_font.
◆ get_kerning()
const math::fvec2 & type::font::get_kerning |
( |
char32_t |
first, |
|
|
char32_t |
second |
|
) |
| const |
Returns the kerning offset for a pair of glyphs.
- Parameters
-
first | UTF-32 character code of the first glyph. |
second | UTF-32 character code of the second glyph. |
- Returns
- Kerning offset.
Definition at line 44 of file font.cpp.
◆ get_kerning_table()
Returns the font's kerning table.
Definition at line 104 of file font.hpp.
◆ kern()
void type::font::kern |
( |
char32_t |
first, |
|
|
char32_t |
second, |
|
|
const math::fvec2 & |
offset |
|
) |
| |
Sets the kerning offset for a pair of glyphs.
- Parameters
-
first | UTF-32 character code of the first glyph. |
second | UTF-32 character code of the second glyph. |
offset | Kerning offset. |
Definition at line 34 of file font.cpp.
◆ set_font_metrics()
void type::font::set_font_metrics |
( |
const font_metrics & |
metrics | ) |
|
Sets the font metrics.
- Parameters
-
Definition at line 39 of file font.cpp.
◆ kerning_table
◆ metrics
The documentation for this class was generated from the following files: