|
HikoGUI
A low latency retained GUI
|
#include <hikogui/font/font_font.hpp>
Data Structures | |
| struct | shape_run_result_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. | |
| glyph_id | find_glyph (char32_t c) const noexcept |
| Get the glyph for a code-point. | |
| lean_vector< glyph_id > | find_glyph (grapheme g) const |
| Get the glyphs for a grapheme. | |
| virtual graphic_path | get_path (hi::glyph_id glyph_id) const =0 |
| Load a glyph into a path. | |
| virtual float | get_advance (hi::glyph_id glyph_id) const =0 |
| Get the advance for a glyph. | |
| virtual glyph_metrics | get_metrics (hi::glyph_id glyph_id) const =0 |
| Load a glyph into a path. | |
| virtual shape_run_result_type | shape_run (iso_639 language, iso_15924 script, gstring run) const =0 |
| Shape a run of graphemes. | |
| glyph_atlas_info & | atlas_info (glyph_id glyph) const |
| 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 |
| font_style | style = font_style::normal |
| bool | condensed = false |
| font_weight | weight = font_weight::regular |
| float | optical_size = 12.0 |
| font_char_map | char_map |
| A optimized character map. | |
| std::string | features |
| A string representing the features of a font. | |
| font_metrics_em | 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.
|
inlinenoexcept |
Get the glyph for a code-point.
Get the glyphs for a grapheme.
|
pure virtual |
Get the advance for a glyph.
| glyph_id | The glyph to look up the advance for. |
| std::exception | If there was an error looking up the glyph. |
Implemented in v1::true_type_font.
|
pure virtual |
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 virtual |
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. |
| std::exception | If there was an error while loading the path. Recommend to disable the font on error. |
Implemented in v1::true_type_font.
|
pure virtualnoexcept |
Return if the font is loaded.
Implemented in v1::true_type_font.
|
pure virtual |
Shape a run of graphemes.
A run of graphemes is a piece of text that is:
A run needs to be shaped by the font-file itself as it handles:
| language | The language of this run of graphemes. |
| script | The script of this run of graphemes. |
| run | The run of graphemes. |
Implemented in v1::true_type_font.
| font_char_map v1::font::char_map |
A optimized character map.
This character map is always available even if the font is not loaded.
| 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'.
| font_metrics_em 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"