Expand description
System-wide font / text rendering settings.
Mirrors the theme::current_visuals / theme::set_visuals pattern and
the scrollbar-style globals (current_scroll_style / set_scroll_style).
Widgets that care about rendering style (Label, Button, TextField,
…) should consult these at layout/paint time so changes made by
the System window propagate without a widget-tree rebuild.
§Convention
Each setting has:
- an override stored in a thread-local cell (
Noneorfalseby default), - a getter (e.g.
current_system_font,lcd_enabled), - a setter (e.g.
set_system_font,set_lcd_enabled).
Widgets pick between the global override and their own per-instance value
— analogous to how a ScrollView takes the global scroll style unless
the caller wired an explicit one.
Functions§
- current_
faux_ italic - current_
faux_ weight - current_
font_ size_ scale - Current font size multiplier. Widgets reading a
self.font_sizeshould consult this (via e.g.Label::active_font_size) so a single slider in the System window can grow or shrink all text uniformly. - current_
gamma - current_
interval - current_
primary_ weight - current_
system_ font - Current system font override, if set. Widgets should prefer this over
their own
self.fontwhen the override isSome(_)so user changes in the System window propagate live. - current_
typography_ epoch - Current typography epoch. Widget render paths read this each frame.
- current_
width - hinting_
enabled - lcd_
enabled - set_
faux_ italic - set_
faux_ weight - set_
font_ size_ scale - Set the system font-size multiplier. Clamped to a sensible range so typos or edge-case inputs can’t hide every label or fry the layout.
- set_
gamma - set_
hinting_ enabled - set_
interval - set_
lcd_ enabled - set_
primary_ weight - set_
system_ font - Replace the system font override. Pass
Noneto clear and fall back to per-widget fonts. - set_
width