23#include "guillaume/systems/typography.hpp"
25#include "guillaume/theme.hpp"
38 const auto &typography =
45 if (
const auto fontSize = typography.getFontSize()) {
46 token.fontSize = *fontSize;
A run of text: its content, its font metrics and the position of the editing cursor.
Which typescale role a text uses (BodyMedium, TitleLarge, ...) and an optional explicit size.
Stores every component of a scene, per component type and per entity identifier, and knows which ones...
ComponentType & getComponent(const Entity::Identifier &entityIdentifier)
Get a component of an entity, to read or modify it.
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
SystemFiller(Phase phase)
ecs::ComponentRegistry & getComponentRegistry(void)
Get the component registry of the scene being processed.
bool requireComponent(const ecs::Entity::Identifier &entityIdentifier)
Tell whether an entity has a component, and log a warning naming the entity and the component when it...
void update(const ecs::Entity::Identifier &entityIdentifier) override
Resolve the metrics of one text for this frame.
Typography(void)
Create the system in the Measure phase.
static void apply(ecs::ComponentRegistry &componentRegistry, const ecs::Entity::Identifier &entityIdentifier)
Resolve the metrics of one text and write them into its components::Text.
State. Every class here is plain data attached to an entity.
The entity-component-system core, independent of any widget.
Rules. Every class here runs each frame on the entities that have the components it declares.
const theme::TypeToken & getTypeToken(theme::TypeRole role)
Get the text style the active theme gives to a role: font family, weight, size, line height and lette...
One text style: everything needed to measure and draw a piece of text.