A FontDatabase performs the act of font selection and glyph selection. It uses the values of FontProperties (except for FontProperties::source_label()) to select suitable font or fonts.
More...
#include <font_database.hpp>
|
| FontDatabase (void) |
|
enum return_code | add_font (const reference_counted_ptr< const FontBase > &h) |
|
enum return_code | add_font_generator (const reference_counted_ptr< const FontGeneratorBase > &h) |
|
template<typename input_iterator , typename output_iterator > |
void | create_glyph_sequence (FontGroup group, input_iterator character_codes_begin, input_iterator character_codes_end, output_iterator output_begin, uint32_t selection_strategy=0u) |
|
template<typename input_iterator , typename output_iterator > |
void | create_glyph_sequence (const FontBase *h, input_iterator character_codes_begin, input_iterator character_codes_end, output_iterator output_begin, uint32_t selection_strategy=0u) |
|
template<typename input_iterator , typename output_iterator > |
void | create_glyph_sequence_no_merging (const FontBase *h, input_iterator character_codes_begin, input_iterator character_codes_end, output_iterator output_begin) |
|
reference_counted_ptr< const FontBase > | fetch_font (c_string source_label) |
|
reference_counted_ptr< const FontBase > | fetch_font (c_string filename, int face_index) |
|
reference_counted_ptr< const FontBase > | fetch_font (FontGroup G, unsigned int N) |
|
reference_counted_ptr< const FontBase > | fetch_font (const FontProperties &props, uint32_t selection_strategy) |
|
GlyphSource | fetch_glyph (const FontProperties &props, uint32_t character_code, uint32_t selection_strategy=0u) |
|
GlyphSource | fetch_glyph (FontGroup group, uint32_t character_code, uint32_t selection_strategy=0u) |
|
GlyphSource | fetch_glyph (const FontBase *h, uint32_t character_code, uint32_t selection_strategy=0u) |
|
GlyphSource | fetch_glyph_no_merging (const FontBase *h, uint32_t character_code) |
|
FontGroup | fetch_group (const FontProperties &props, uint32_t selection_strategy) |
|
reference_counted_ptr< const FontBase > | fetch_or_generate_font (const reference_counted_ptr< const FontGeneratorBase > &h) |
|
unsigned int | number_fonts (FontGroup G) |
|
FontGroup | parent_group (FontGroup G) |
|
FontGroup | root_group (void) |
|
| reference_counted_base (void) |
|
A FontDatabase performs the act of font selection and glyph selection. It uses the values of FontProperties (except for FontProperties::source_label()) to select suitable font or fonts.
Definition at line 38 of file font_database.hpp.
◆ selection_bits_t
Enumeration to define bits for how fonts and glyphs are selected.
Definition at line 91 of file font_database.hpp.
◆ FontDatabase()
fastuidraw::FontDatabase::FontDatabase |
( |
void |
| ) |
|
|
explicit |
◆ add_font()
Add a font to this FontDatabase; the value of FontBase::properties().source_label() will be used as a key to uniquely identify the font. If a font is already present with the the same value, will return routine_fail and not add the font.
- Parameters
-
◆ add_font_generator()
◆ fetch_font() [1/4]
◆ fetch_font() [2/4]
Provided as a conveniance, equivalent to
std::ostringstream str;
str << filename << ":" << face_index;
- Parameters
-
filename | file source of font to hunt for |
face_index | face index source of font to hunt for |
◆ fetch_font() [3/4]
Returns a font of a FontGroup
- Parameters
-
G | FontGroup to query |
N | index of font with 0 <= N < number_fonts(G) |
◆ fetch_font() [4/4]
Fetch a font from a FontProperties description. The return value will be the closest matched font added with add_font().
- Parameters
-
props | FontProperties by which to search |
selection_strategy | using bit-wise ors of values of selection_bits_t to choose the matching criteria of selecting a font. |
◆ fetch_glyph() [1/3]
GlyphSource fastuidraw::FontDatabase::fetch_glyph |
( |
const FontProperties & |
props, |
|
|
uint32_t |
character_code, |
|
|
uint32_t |
selection_strategy = 0u |
|
) |
| |
Fetch a GlyphSource with font merging from a glyph rendering type, font properties and character code.
- Parameters
-
props | font properties used to fetch font |
character_code | character code of glyph to fetch |
selection_strategy | using bit-wise ors of values of selection_bits_t to choose the matching criteria of selecting a font. |
◆ fetch_glyph() [2/3]
GlyphSource fastuidraw::FontDatabase::fetch_glyph |
( |
FontGroup |
group, |
|
|
uint32_t |
character_code, |
|
|
uint32_t |
selection_strategy = 0u |
|
) |
| |
Fetch a GlyphSource with font merging from a glyph rendering type, font properties and character code.
- Parameters
-
group | FontGroup used to fetch font |
character_code | character code of glyph to fetch |
selection_strategy | using bit-wise ors of values of selection_bits_t to choose the matching criteria of selecting a font. |
◆ fetch_glyph() [3/3]
GlyphSource fastuidraw::FontDatabase::fetch_glyph |
( |
const FontBase * |
h, |
|
|
uint32_t |
character_code, |
|
|
uint32_t |
selection_strategy = 0u |
|
) |
| |
Fetch a GlyphSource with font merging from a glyph rendering type, font preference and character code.
- Parameters
-
h | pointer to font from which to fetch the glyph, if the glyph is not present in the font attempt to get the glyph from a font of similiar properties |
character_code | character code of glyph to fetch |
selection_strategy | using bit-wise ors of values of selection_bits_t to choose the matching criteria of selecting a font. |
◆ fetch_glyph_no_merging()
GlyphSource fastuidraw::FontDatabase::fetch_glyph_no_merging |
( |
const FontBase * |
h, |
|
|
uint32_t |
character_code |
|
) |
| |
Fetch a GlyphSource without font merging from a glyph rendering type, font and character code.
- Parameters
-
h | pointer to font from which to fetch the glyph, if the glyph is not present in the font, then return an invalid Glyph. |
character_code | character code of glyph to fetch |
◆ fetch_group()
Fetch a FontGroup from a FontProperties value
- Parameters
-
props | font properties used to generate group. |
selection_strategy | using bit-wise ors of values of selection_bits_t to choose the matching criteria of selecting a font. |
◆ fetch_or_generate_font()
If the font named by a generator is not yet part of the FontDatabase, add it the FontDatabase, otherwise use the existing generator. From the generator, return the font it generates.
◆ number_fonts()
unsigned int fastuidraw::FontDatabase::number_fonts |
( |
FontGroup |
G | ) |
|
Returns the number of fonts in a FontGroup
- Parameters
-
◆ parent_group()
◆ root_group()
FontGroup fastuidraw::FontDatabase::root_group |
( |
void |
| ) |
|
The documentation for this class was generated from the following file: