guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
guillaume::systems::MeasureTextCacheKey Struct Reference

Key of the size cache of MeasureText: everything a measured size is looked up by. More...

#include <headers/guillaume/systems/measure_text.hpp>

Public Member Functions

bool operator== (const MeasureTextCacheKey &other) const
 Compare two keys field by field.
bool operator!= (const MeasureTextCacheKey &other) const
 Negation of operator==.
bool operator< (const MeasureTextCacheKey &other) const
 Order two keys by content, then font size, then color, then font weight.

Public Attributes

std::string content
 The string that was measured.
float fontSize
 Font size the string was measured at.
utility::graphic::Color32Bit color
theme::FontWeight fontWeight
 Font weight, which selects the font file measured with.

Detailed Description

Key of the size cache of MeasureText: everything a measured size is looked up by.

Two texts with equal keys share one measurement. The ordering operator exists so the key can be used in the ordered map of utility::Cache.

See also
MeasureText

Definition at line 50 of file measure_text.hpp.

Member Function Documentation

◆ operator!=()

bool guillaume::systems::MeasureTextCacheKey::operator!= ( const MeasureTextCacheKey & other) const
inline

Negation of operator==.

Parameters
otherThe key to compare with.
Returns
True when at least one field differs.

Definition at line 88 of file measure_text.hpp.

◆ operator<()

bool guillaume::systems::MeasureTextCacheKey::operator< ( const MeasureTextCacheKey & other) const
inline

Order two keys by content, then font size, then color, then font weight.

Parameters
otherThe key to compare with.
Returns
True when this key sorts before other.

Definition at line 99 of file measure_text.hpp.

◆ operator==()

bool guillaume::systems::MeasureTextCacheKey::operator== ( const MeasureTextCacheKey & other) const
inline

Compare two keys field by field.

Parameters
otherThe key to compare with.
Returns
True when content, font size, color and font weight are all equal.

Definition at line 66 of file measure_text.hpp.

Member Data Documentation

◆ color

utility::graphic::Color32Bit guillaume::systems::MeasureTextCacheKey::color

Color of the text. It does not change the size, but two colors give two cache entries

Definition at line 54 of file measure_text.hpp.

◆ content

std::string guillaume::systems::MeasureTextCacheKey::content

The string that was measured.

Definition at line 51 of file measure_text.hpp.

◆ fontSize

float guillaume::systems::MeasureTextCacheKey::fontSize

Font size the string was measured at.

Definition at line 52 of file measure_text.hpp.

◆ fontWeight

theme::FontWeight guillaume::systems::MeasureTextCacheKey::fontWeight
Initial value:

Font weight, which selects the font file measured with.

Definition at line 56 of file measure_text.hpp.


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