FontBase provides an interface for a font to generate glyph rendering data.
More...
#include <font.hpp>
FontBase provides an interface for a font to generate glyph rendering data.
Definition at line 47 of file font.hpp.
◆ FontBase()
Ctor.
- Parameters
-
pprops | font properties describing the font |
pmetrics | metrics common to all glyphs of the font |
◆ can_create_rendering_data()
virtual bool fastuidraw::FontBase::can_create_rendering_data |
( |
enum glyph_type |
tp | ) |
const |
|
pure virtual |
◆ compute_metrics()
virtual void fastuidraw::FontBase::compute_metrics |
( |
uint32_t |
glyph_code, |
|
|
GlyphMetricsValue & |
metrics |
|
) |
| const |
|
pure virtual |
To be implemented by a derived class to provide the metrics data for the named glyph.
- Parameters
-
| glyph_code | glyph code of glyph to compute the metric values |
[out] | metrics | location to which to place the metric values for the glyph |
Implemented in fastuidraw::FontFreeType.
◆ compute_rendering_data()
To be implemented by a derived class to generate glyph rendering data given a glyph code and GlyphRenderer.
- Parameters
-
| render | specifies object to return via GlyphRenderer::type(), it is guaranteed by the caller that can_create_rendering_data() returns true on render.type() |
| glyph_metrics | GlyphMetrics values as computed by compute_metrics() |
[out] | path | location to which to write the Path of the glyph |
[out] | render_size | location to which to write the render size of the glyph |
Implemented in fastuidraw::FontFreeType.
◆ glyph_code()
uint32_t fastuidraw::FontBase::glyph_code |
( |
uint32_t |
pcharacter_code | ) |
const |
|
inline |
Provided as a conveniance to fetch a single glyph_code.
- Parameters
-
pcharacter_code | Unicode character code from which to fetch a glyph code. |
Definition at line 131 of file font.hpp.
◆ glyph_codes() [1/2]
To be implemented by a derived class to return the index values (glyph codes) for a sequence of character code. A glyph code of 0 indicates that a character code is not present in the font.
- Parameters
-
| encoding | character encoding of character codes |
| in_character_codes | character codes from which to fetch glyph codes |
[out] | out_glyph_codes | location to which to write glyph codes. |
Implemented in fastuidraw::FontFreeType.
◆ glyph_codes() [2/2]
void fastuidraw::FontBase::glyph_codes |
( |
c_array< const uint32_t > |
in_character_codes, |
|
|
c_array< uint32_t > |
out_glyph_codes |
|
) |
| const |
|
inline |
Provided as a conveniance, equivalent to
in_character_codes,
out_glyph_codes);
- Parameters
-
| in_character_codes | character codes from which to fetch glyph codes |
[out] | out_glyph_codes | location to which to write glyph codes. |
Definition at line 118 of file font.hpp.
◆ metrics()
const FontMetrics& fastuidraw::FontBase::metrics |
( |
void |
| ) |
const |
Returns the metrics of the font.
◆ number_glyphs()
virtual unsigned int fastuidraw::FontBase::number_glyphs |
( |
void |
| ) |
const |
|
pure virtual |
◆ properties()
Returns the properties of the font.
◆ unique_id()
unsigned int fastuidraw::FontBase::unique_id |
( |
void |
| ) |
const |
Returns the unique ID of the FontBase object. The value is gauranteed to be unique and different from any previously created fonts (even those that have been destroyed). The value is assigned by the first FontBase created gets the value 0 and each subsequence FontBase created increments the global value by 1. Thus it is reasonable, to use arrays instead of associative keys for font choosing.
The documentation for this class was generated from the following file:
- /home/kevin/fastuidraw.krogueintel/inc/fastuidraw/text/font.hpp