HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
tt::Font Class Referenceabstract

#include <TTauri/Text/Font.hpp>

Inheritance diagram for tt::Font:
tt::TrueTypeFont

Public Member Functions

 Font (Font const &)=delete
 
Fontoperator= (Font const &)=delete
 
 Font (Font &&)=delete
 
Fontoperator= (Font &&)=delete
 
virtual GlyphID find_glyph (char32_t c) const noexcept=0
 Get the glyph for a code-point.
 
FontGlyphIDs find_glyph (Grapheme g) const noexcept
 Get the glyphs for a grapheme.
 
virtual std::optional< GlyphIDloadGlyph (GlyphID glyph_id, Path &path) const noexcept=0
 
virtual bool loadGlyphMetrics (GlyphID glyph_id, GlyphMetrics &metrics, GlyphID lookahead_glyph_id=GlyphID{}) const noexcept=0
 

Data Fields

FontDescription description
 The description is filled with information parsed from the font.
 

Detailed Description

A font. This class has information on how to shape text and get glyphs consisting of bezier contours.

Member Function Documentation

◆ find_glyph() [1/2]

virtual GlyphID tt::Font::find_glyph ( char32_t c) const
pure virtualnoexcept

Get the glyph for a code-point.

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

Implemented in tt::TrueTypeFont.

◆ find_glyph() [2/2]

FontGlyphIDs tt::Font::find_glyph ( Grapheme g) const
noexcept

Get the glyphs for a grapheme.

Returns
a set of glyph-ids, or invalid when not found or error.

◆ loadGlyph()

virtual std::optional< GlyphID > tt::Font::loadGlyph ( GlyphID glyph_id,
Path & path ) const
pure virtualnoexcept

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

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

Implemented in tt::TrueTypeFont.

◆ loadGlyphMetrics()

virtual bool tt::Font::loadGlyphMetrics ( GlyphID glyph_id,
GlyphMetrics & metrics,
GlyphID lookahead_glyph_id = GlyphID{} ) const
pure virtualnoexcept

Load a glyph 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.
Returns
true on success, false on error.

Implemented in tt::TrueTypeFont.

Field Documentation

◆ description

FontDescription tt::Font::description

The description is filled with information parsed from the font.


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