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

Public Member Functions

 TrueTypeFont (nonstd::span< std::byte const > bytes)
 
 TrueTypeFont (std::unique_ptr< ResourceView > view)
 
 TrueTypeFont (TrueTypeFont const &other)=delete
 
TrueTypeFontoperator= (TrueTypeFont const &other)=delete
 
 TrueTypeFont (TrueTypeFont &&other)=delete
 
TrueTypeFontoperator= (TrueTypeFont &&other)=delete
 
GlyphID find_glyph (char32_t c) const noexcept override
 Get the glyph for a code-point.
 
std::optional< GlyphIDloadGlyph (GlyphID glyph_id, Path &path) const noexcept override
 
bool loadGlyphMetrics (GlyphID glyph_id, GlyphMetrics &metrics, GlyphID lookahead_glyph_id=GlyphID{}) const noexcept override
 
- Public Member Functions inherited from tt::Font
 Font (Font const &)=delete
 
Fontoperator= (Font const &)=delete
 
 Font (Font &&)=delete
 
Fontoperator= (Font &&)=delete
 
FontGlyphIDs find_glyph (Grapheme g) const noexcept
 Get the glyphs for a grapheme.
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ TrueTypeFont()

tt::TrueTypeFont::TrueTypeFont ( nonstd::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()

GlyphID tt::TrueTypeFont::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< GlyphID > tt::TrueTypeFont::loadGlyph ( GlyphID glyph_id,
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.

◆ loadGlyphMetrics()

bool tt::TrueTypeFont::loadGlyphMetrics ( GlyphID glyph_id,
GlyphMetrics & metrics,
GlyphID lookahead_glyph_id = GlyphID{} ) const
overridevirtualnoexcept

Load a glyphMetrics into a path. The glyph is directly loaded from the font file.

Parameters
glyphIndexthe 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: