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::true_type_font

Public Member Functions

 font (font const &)=delete
 
fontoperator= (font const &)=delete
 
 font (font &&)=delete
 
fontoperator= (font &&)=delete
 
virtual tt::glyph_id find_glyph (char32_t c) const noexcept=0
 Get the glyph for a code-point.
 
font_glyph_ids find_glyph (grapheme g) const noexcept
 Get the glyphs for a grapheme.
 
virtual std::optional< tt::glyph_idloadGlyph (tt::glyph_id glyph_id, graphic_path &path) const noexcept=0
 
virtual bool loadglyph_metrics (tt::glyph_id glyph_id, glyph_metrics &metrics, tt::glyph_id lookahead_glyph_id=tt::glyph_id{}) const noexcept=0
 

Data Fields

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

◆ find_glyph() [2/2]

font_glyph_ids 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< tt::glyph_id > tt::font::loadGlyph ( tt::glyph_id glyph_id,
graphic_path & path ) const
pure virtualnoexcept

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

Parameters
glyph_idthe id 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::true_type_font.

◆ loadglyph_metrics()

virtual bool tt::font::loadglyph_metrics ( tt::glyph_id glyph_id,
glyph_metrics & metrics,
tt::glyph_id lookahead_glyph_id = tt::glyph_id{} ) const
pure virtualnoexcept

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

Parameters
glyph_idthe id of a glyph inside the font.
metricsThe metrics constructed by the loader.
lookahead_glyph_idThe id of a glyph to the right, needed for kerning.
Returns
true on success, false on error.

Implemented in tt::true_type_font.

Field Documentation

◆ description

font_description tt::font::description

The description is filled with information parsed from the font.


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