HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
v1::true_type_font Class Referencefinal
Inheritance diagram for v1::true_type_font:
v1::font

Public Member Functions

 true_type_font (std::unique_ptr< resource_view > view)
 
 true_type_font (std::filesystem::path const &path)
 
 true_type_font (true_type_font const &other)=delete
 
true_type_fontoperator= (true_type_font const &other)=delete
 
 true_type_font (true_type_font &&other)=delete
 
true_type_fontoperator= (true_type_font &&other)=delete
 
bool loaded () const noexcept override
 Return if the font is loaded.
 
hi::glyph_id find_glyph (char32_t c) const noexcept override
 Get the glyph for a code-point.
 
std::optional< hi::glyph_id > load_glyph (hi::glyph_id glyph_id, graphic_path &path) const noexcept override
 Load a glyph into a path.
 
bool load_glyph_metrics (hi::glyph_id glyph_id, glyph_metrics &metrics, hi::glyph_id lookahead_glyph_id=hi::glyph_id{}) const noexcept override
 Load a glyphMetrics into a path.
 
vector2 get_kerning (hi::glyph_id current_glyph, hi::glyph_id next_glyph) const noexcept override
 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 override
 Substitute and kern a run of glyphs.
 
- Public Member Functions inherited from v1::font
 font (font const &)=delete
 
fontoperator= (font const &)=delete
 
 font (font &&)=delete
 
fontoperator= (font &&)=delete
 
hi::glyph_ids find_glyph (grapheme g) const noexcept
 Get the glyphs for a grapheme.
 
glyph_atlas_infoatlas_info (glyph_ids const &glyphs) const noexcept
 
font_variant font_variant () const noexcept
 

Additional Inherited Members

- Data Fields inherited from v1::font
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.
 

Member Function Documentation

◆ find_glyph()

hi::glyph_id v1::true_type_font::find_glyph ( char32_t c) const
overridevirtualnoexcept

Get the glyph for a code-point.

Returns
glyph-index, or invalid when not found or error.

Implements v1::font.

◆ get_kerning()

vector2 v1::true_type_font::get_kerning ( hi::glyph_id current_glyph,
hi::glyph_id next_glyph ) const
overridevirtualnoexcept

Get the kerning between two glyphs.

Parameters
current_glyphThe glyph on the left
next_glyphThe glyph on the right
Returns
The vector to add to the advance of the current_glyph.

Implements v1::font.

◆ load_glyph()

std::optional< hi::glyph_id > v1::true_type_font::load_glyph ( hi::glyph_id glyph_id,
graphic_path & path ) const
overridevirtualnoexcept

Load a glyph into a path.

The glyph is directly loaded from the font file.

Parameters
glyph_idthe index of a glyph inside the font.
pathThe path constructed by the loader.
Returns
empty on failure, or the glyphID of the metrics to use.

Implements v1::font.

◆ load_glyph_metrics()

bool v1::true_type_font::load_glyph_metrics ( hi::glyph_id glyph_id,
glyph_metrics & metrics,
hi::glyph_id lookahead_glyph_id = hi::glyph_id{} ) const
overridevirtualnoexcept

Load a glyphMetrics into a path.

The glyph is directly loaded from the font file.

Parameters
glyph_idthe index of a glyph inside the font.
metricsThe metrics constructed by the loader.
lookahead_glyph_idThe next glyph, used for determining kerning.
Returns
1 on success, 0 on not implemented

Implements v1::font.

◆ loaded()

bool v1::true_type_font::loaded ( ) const
inlineoverridevirtualnoexcept

Return if the font is loaded.

Returns
true if the font is fully loaded, false if only metadata of the font is available.

Implements v1::font.

◆ substitution_and_kerning()

virtual void v1::true_type_font::substitution_and_kerning ( iso_639 language,
iso_15924 script,
std::vector< substitution_and_kerning_type > & word ) const
inlineoverridevirtualnoexcept

Substitute and kern a run of glyphs.

Parameters
languageThe language that the word is written in.
scriptThe script that the word is written in.
[in,out]wordA run of glyphs, from the same font, font-size and script of a word.

Implements v1::font.


The documentation for this class was generated from the following file: