Egui::Fonts
Inherits Reference < Object
Constants
Memoized layouts (upstream caches galleys in Fonts too): a
widget re-layouts its text every frame, which is fine for labels
but pins a textarea with a multi-megabyte buffer to a full
re-wrap (measure per word) at every frame. Keys compare by
String identity first (== short-circuits on the same object),
so an unchanged buffer hits in O(1). Small MRU ring — enough for
the handful of texts on screen at one size and wrap width.
Estimated line height as a font-size factor (matches MonospaceFonts; used by containers that need a row height before measuring).
Instance methods
Truncate text with an ellipsis so it measures at most
max_width (upstream's galley truncation). Returns the text
unchanged when it already fits, "…" when only the ellipsis
fits, "" when not even that does. Binary-searches the prefix
length through measure_cached, so a squeezed widget pays
O(log n) measures.
Lay styled runs out into rows. max_width nil = never wrap.
resolve maps a run's family + bold/italic flags to its font
stack (a Context#fonts_for closure) so runs tagged with another
family (inline monospace code) or a real variant face MEASURE
through that stack; nil measures everything through self (the
historical behavior — fine when no run carries a family/variant).
Memoized measure for STATIC text (label-like widgets — see
AtlasFonts#measure_cached for the cache design). The base class
and every non-AtlasFonts backend just measure; only the real
font stacks gain a cache, so headless specs see identical
behavior either way.
Source font FILE this stack was built from (nil for synthetic
stacks) — Context#primary_family_name reads the weight axis
family through it. Set by the backends' from_system builders.
Source font FILE this stack was built from (nil for synthetic
stacks) — Context#primary_family_name reads the weight axis
family through it. Set by the backends' from_system builders.