HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
tt::glyph_metrics Struct Reference

#include <ttauri/text/glyph_metrics.hpp>

Public Member Functions

 glyph_metrics (glyph_metrics const &) noexcept=default
 
 glyph_metrics (glyph_metrics &&) noexcept=default
 
glyph_metricsoperator= (glyph_metrics const &) noexcept=default
 
glyph_metricsoperator= (glyph_metrics &&) noexcept=default
 
vector2 advanceForgrapheme (int index) const noexcept
 
glyph_metricsscale (float rhs) noexcept
 

Data Fields

aarectangle boundingBox = {}
 
float leftSideBearing = 0.0f
 
float rightSideBearing = 0.0f
 
float ascender = 0.0f
 
float descender = 0.0f
 
float lineGap = 0.0f
 
float capHeight = 0.0f
 
float xHeight = 0.0f
 
vector2 advance = {0.0f, 0.0f}
 
int numberOfgraphemes = 1
 

Detailed Description

Metrics of a glyph. This information is used to position glyphs next to each other and determinate the size of a shaped text.

Member Function Documentation

◆ advanceForgrapheme()

vector2 tt::glyph_metrics::advanceForgrapheme ( int index) const
inlinenoexcept

Get the advanceWidth for the specific grapheme of a potential ligature.

Field Documentation

◆ advance

vector2 tt::glyph_metrics::advance = {0.0f, 0.0f}

The distance to the next character.

◆ ascender

float tt::glyph_metrics::ascender = 0.0f

Distance from baseline of highest ascender.

◆ boundingBox

aarectangle tt::glyph_metrics::boundingBox = {}

Bounding box of the path.

◆ capHeight

float tt::glyph_metrics::capHeight = 0.0f

Height of capital letter, or height of the letter 'H'.

◆ descender

float tt::glyph_metrics::descender = 0.0f

Distance from baseline of lowest descender.

◆ leftSideBearing

float tt::glyph_metrics::leftSideBearing = 0.0f

This is the position where the left side of the glyph starts. This includes some leading white space so that the glyph will stand a small distance of the edge.

For many glyphs the leftSideBearing is the origin.

◆ lineGap

float tt::glyph_metrics::lineGap = 0.0f

Distance between lines.

◆ numberOfgraphemes

int tt::glyph_metrics::numberOfgraphemes = 1

The number of graphemes this glyph represents. This may be larger than one when the glyph is a ligature.

◆ rightSideBearing

float tt::glyph_metrics::rightSideBearing = 0.0f

This is the position where the right side of the glyph ends. This includes some leading white space so that the glyph will stand a small distance of the edge.

◆ xHeight

float tt::glyph_metrics::xHeight = 0.0f

Height of the small letter 'x'.


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