|
HikoGUI
A low latency retained GUI
|
#include <hikogui/text/font.hpp>
Data Structures | |
| struct | substitution_and_kerning_type |
Public Member Functions | |
| font (font const &)=delete | |
| font & | operator= (font const &)=delete |
| font (font &&)=delete | |
| font & | operator= (font &&)=delete |
| virtual bool | loaded () const noexcept=0 |
| Return if the font is loaded. | |
| virtual hi::glyph_id | find_glyph (char32_t c) const noexcept=0 |
| Get the glyph for a code-point. | |
| hi::glyph_ids | find_glyph (grapheme g) const noexcept |
| Get the glyphs for a grapheme. | |
| virtual std::optional< hi::glyph_id > | load_glyph (hi::glyph_id glyph_id, graphic_path &path) const noexcept=0 |
| virtual bool | load_glyph_metrics (hi::glyph_id glyph_id, glyph_metrics &metrics, hi::glyph_id lookahead_glyph_id=hi::glyph_id{}) const noexcept=0 |
| virtual vector2 | get_kerning (hi::glyph_id current_glyph, hi::glyph_id next_glyph) const noexcept=0 |
| Get the kerning between two glyphs. | |
| virtual void | substitution_and_kerning (iso_639 language, iso_15924 script, std::vector< substitution_and_kerning_type > &word) const noexcept=0 |
| Substitute and kern a run of glyphs. | |
| glyph_atlas_info & | atlas_info (glyph_ids const &glyphs) const noexcept |
| font_variant | font_variant () const noexcept |
Data Fields | |
| std::string | family_name |
| The family name as parsed from the font file. | |
| std::string | sub_family_name |
| The sub-family name as parsed from the font file. | |
| bool | monospace = false |
| bool | serif = false |
| bool | italic = false |
| bool | condensed = false |
| font_weight | weight = font_weight::Regular |
| float | optical_size = 12.0 |
| std::string | features |
| A string representing the features of a font. | |
| hi::unicode_mask | unicode_mask |
| hi::font_metrics | metrics |
| The metrics of a font. | |
| std::vector< hi::font * > | fallback_chain |
| List of fonts to use as a fallback for this font. | |
Friends | |
| std::string | to_string (font const &rhs) noexcept |
A font. This class has information on how to shape text and get glyphs consisting of bezier contours.
|
pure virtualnoexcept |
Get the glyph for a code-point.
Implemented in v1::true_type_font.
|
noexcept |
Get the glyphs for a grapheme.
|
pure virtualnoexcept |
Get the kerning between two glyphs.
| current_glyph | The glyph on the left |
| next_glyph | The glyph on the right |
Implemented in v1::true_type_font.
|
pure virtualnoexcept |
Load a glyph into a path. The glyph is directly loaded from the font file.
| glyph_id | the id of a glyph inside the font. |
| path | The path constructed by the loader. |
Implemented in v1::true_type_font.
|
pure virtualnoexcept |
Load a glyph into a path. The glyph is directly loaded from the font file.
| glyph_id | the id of a glyph inside the font. |
| metrics | The metrics constructed by the loader. |
| lookahead_glyph_id | The id of a glyph to the right, needed for kerning. |
Implemented in v1::true_type_font.
|
pure virtualnoexcept |
Return if the font is loaded.
Implemented in v1::true_type_font.
|
pure virtualnoexcept |
Substitute and kern a run of glyphs.
| language | The language that the word is written in. | |
| script | The script that the word is written in. | |
| [in,out] |
A run of glyphs, from the same font, font-size and script of a word.
Implemented in v1::true_type_font.
| std::vector<hi::font *> v1::font::fallback_chain |
List of fonts to use as a fallback for this font.
| std::string v1::font::family_name |
The family name as parsed from the font file.
Examples: "Helvetica", "Times New Roman"
| std::string v1::font::features |
A string representing the features of a font.
This will be a comma separated list of features, mostly tables like 'kern' and 'GPOS'.
| hi::font_metrics v1::font::metrics |
The metrics of a font.
| std::string v1::font::sub_family_name |
The sub-family name as parsed from the font file.
Examples: "Regular", "ItalicBold"