TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::TextStyle Class Reference

What text is measured and laid out from: font, metrics and decoration lines. More...

#include <gui_core/style/gui_style_text.h>

Public Member Functions

uint64_t GetHashCode () const noexcept
bool operator== (const TextStyle &other) const noexcept
float CalcLineHeight () const
 Line pitch in the style's units.

Public Attributes

float fontSize = 0
 CSS: font-size, in CSS px.
float lineHeight = 1.25f
 CSS: line-height, read per lineHeightType (by default a multiple of fontSize).
float letterSpacing = 0.0f
 CSS px; stored and scaled, not applied by the text system.
float wordSpacing = 0.0f
 CSS px; stored and scaled, not applied by the text system.
FontFamily family = FontFamily::Default
 generic family, used when fontId isn't registered
FontWeight weight = FontWeight::Normal
FontStyle style = FontStyle::Normal
FontStretch stretch = FontStretch::Normal
LineHeight lineHeightType = LineHeight::FontSizeRelative
 how lineHeight is interpreted
FontID fontId = FontID::Invalid
 overrides family when set
LanguageTag language
 Picks regional letterforms (e.g. CJK); empty = the text system's default.
TextDecoration throughLine
 through the text
TextDecoration bottomLine
 under the descender
TextDecoration underLine
 under the alphabetic baseline
TextDecoration overLine
 over the ascender

Detailed Description

What text is measured and laid out from: font, metrics and decoration lines.

One per state of a Style; the colors it's drawn in are StyleState::textColor and StyleState::decorationColors, so a state that only recolors keeps the layout. Metrics are in CSS px until StyleManager::Register (or ToPixels) scales them to the UI.

Member Function Documentation

◆ GetHashCode()

uint64_t tachyon::TextStyle::GetHashCode ( ) const
noexcept

◆ operator==()

bool tachyon::TextStyle::operator== ( const TextStyle & other) const
inlinenoexcept

◆ CalcLineHeight()

float tachyon::TextStyle::CalcLineHeight ( ) const
inline

Line pitch in the style's units.

Normal / MetricsRelative need font metrics, so they return fontSize.

Member Data Documentation

◆ fontSize

float tachyon::TextStyle::fontSize = 0

CSS: font-size, in CSS px.

◆ lineHeight

float tachyon::TextStyle::lineHeight = 1.25f

CSS: line-height, read per lineHeightType (by default a multiple of fontSize).

A fixed pitch, so a fallback font with tall metrics can't stretch a line.

◆ letterSpacing

float tachyon::TextStyle::letterSpacing = 0.0f

CSS px; stored and scaled, not applied by the text system.

◆ wordSpacing

float tachyon::TextStyle::wordSpacing = 0.0f

CSS px; stored and scaled, not applied by the text system.

◆ family

FontFamily tachyon::TextStyle::family = FontFamily::Default

generic family, used when fontId isn't registered

◆ weight

FontWeight tachyon::TextStyle::weight = FontWeight::Normal

◆ style

FontStyle tachyon::TextStyle::style = FontStyle::Normal

◆ stretch

FontStretch tachyon::TextStyle::stretch = FontStretch::Normal

◆ lineHeightType

LineHeight tachyon::TextStyle::lineHeightType = LineHeight::FontSizeRelative

how lineHeight is interpreted

◆ fontId

FontID tachyon::TextStyle::fontId = FontID::Invalid

overrides family when set

◆ language

LanguageTag tachyon::TextStyle::language

Picks regional letterforms (e.g. CJK); empty = the text system's default.

◆ throughLine

TextDecoration tachyon::TextStyle::throughLine

through the text

◆ bottomLine

TextDecoration tachyon::TextStyle::bottomLine

under the descender

◆ underLine

TextDecoration tachyon::TextStyle::underLine

under the alphabetic baseline

◆ overLine

TextDecoration tachyon::TextStyle::overLine

over the ascender


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