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

#include <TTauri/Text/GlyphMetrics.hpp>

Public Member Functions

 GlyphMetrics (GlyphMetrics const &) noexcept=default
 
 GlyphMetrics (GlyphMetrics &&) noexcept=default
 
GlyphMetricsoperator= (GlyphMetrics const &) noexcept=default
 
GlyphMetricsoperator= (GlyphMetrics &&) noexcept=default
 
vec advanceForGrapheme (int index) const noexcept
 
GlyphMetricsscale (float rhs) noexcept
 

Data Fields

aarect 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
 
vec 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()

vec tt::GlyphMetrics::advanceForGrapheme ( int index) const
inlinenoexcept

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

Field Documentation

◆ advance

vec tt::GlyphMetrics::advance = {0.0f, 0.0f}

The distance to the next character.

◆ ascender

float tt::GlyphMetrics::ascender = 0.0f

Distance from baseline of highest ascender.

◆ boundingBox

aarect tt::GlyphMetrics::boundingBox = {}

Bounding box of the path.

◆ capHeight

float tt::GlyphMetrics::capHeight = 0.0f

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

◆ descender

float tt::GlyphMetrics::descender = 0.0f

Distance from baseline of lowest descender.

◆ leftSideBearing

float tt::GlyphMetrics::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::GlyphMetrics::lineGap = 0.0f

Distance between lines.

◆ numberOfGraphemes

int tt::GlyphMetrics::numberOfGraphemes = 1

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

◆ rightSideBearing

float tt::GlyphMetrics::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::GlyphMetrics::xHeight = 0.0f

Height of the small letter 'x'.


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