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

Public Member Functions

 true_type_font (std::span< std::byte const > bytes)
 Load a true type font.
 
 true_type_font (std::unique_ptr< resource_view > view)
 
 true_type_font (URL const &url)
 
 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
 
tt::glyph_id find_glyph (char32_t c) const noexcept override
 Get the glyph for a code-point.
 
std::optional< tt::glyph_idloadGlyph (tt::glyph_id glyph_id, graphic_path &path) const noexcept override
 Load a glyph into a path.
 
bool loadglyph_metrics (tt::glyph_id glyph_id, glyph_metrics &metrics, tt::glyph_id lookahead_glyph_id=tt::glyph_id{}) const noexcept override
 Load a glyphMetrics into a path.
 
- Public Member Functions inherited from tt::font
 font (font const &)=delete
 
fontoperator= (font const &)=delete
 
 font (font &&)=delete
 
fontoperator= (font &&)=delete
 
font_glyph_ids find_glyph (grapheme g) const noexcept
 Get the glyphs for a grapheme.
 

Additional Inherited Members

- Data Fields inherited from tt::font
font_description description
 The description is filled with information parsed from the font.
 

Constructor & Destructor Documentation

◆ true_type_font()

tt::true_type_font::true_type_font ( std::span< std::byte const > bytes)
inline

Load a true type font.

The methods in this class will parse the true-type font at run time. This also means that the bytes passed into this constructor will need to remain available.

Member Function Documentation

◆ find_glyph()

tt::glyph_id tt::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 tt::font.

◆ loadGlyph()

std::optional< tt::glyph_id > tt::true_type_font::loadGlyph ( tt::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 tt::font.

◆ loadglyph_metrics()

bool tt::true_type_font::loadglyph_metrics ( tt::glyph_id glyph_id,
glyph_metrics & metrics,
tt::glyph_id lookahead_glyph_id = tt::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 tt::font.


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