|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Which typescale role a text uses (BodyMedium, TitleLarge, ...) and an optional explicit size. More...
#include <headers/guillaume/components/typography.hpp>


Public Member Functions | |
| Typography (void)=default | |
| Default constructor. | |
| ~Typography (void)=default | |
| Default destructor. | |
| theme::TypeRole | getRole (void) const |
| Get the typescale role. | |
| Typography & | setRole (theme::TypeRole role) |
| Set the typescale role. | |
| std::optional< float > | getFontSize (void) const |
| Get the explicit font size. | |
| Typography & | setFontSize (std::optional< float > fontSize) |
| Override the font size of the role, or clear the override. | |
| Public Member Functions inherited from guillaume::ecs::Component | |
| bool | hasChanged (void) const |
| Tell whether a value of the component changed since the flags were last reset (the end of the previous frame). | |
| void | setHasChanged (bool hasChanged) |
| Raise or lower the changed flag. | |
| Component (void)=default | |
| Create a component that is not marked as changed. | |
| virtual | ~Component (void)=default |
| Virtual destructor, so components can be destroyed through the base class. | |
Which typescale role a text uses (BodyMedium, TitleLarge, ...) and an optional explicit size.
entities::Text writes it. systems::Typography reads it every frame in the Measure phase, resolves the role against the active theme and writes the font size, weight, line height and letter spacing into the entity's components::Text, so a theme change restyles existing texts.
Definition at line 53 of file typography.hpp.
| std::optional< float > guillaume::components::Typography::getFontSize | ( | void | ) | const |
Get the explicit font size.
Definition at line 42 of file typography.cpp.
| theme::TypeRole guillaume::components::Typography::getRole | ( | void | ) | const |
Get the typescale role.
Definition at line 27 of file typography.cpp.
| Typography & guillaume::components::Typography::setFontSize | ( | std::optional< float > | fontSize | ) |
Override the font size of the role, or clear the override.
Only the size is replaced: the weight, line height and letter spacing still come from the role. Marks the component changed only when the value differs.
| fontSize | The size, in dp, or std::nullopt to use the size of the role. |
Definition at line 47 of file typography.cpp.


| Typography & guillaume::components::Typography::setRole | ( | theme::TypeRole | role | ) |
Set the typescale role.
Marks the component changed only when the role differs.
| role | The role systems::Typography resolves against the active theme. |
Definition at line 32 of file typography.cpp.
