pub struct LoadedFont {
pub atlas_slot: usize,
pub metrics: FontMetrics,
pub atlas_w: u32,
pub atlas_h: u32,
pub size_px: f32,
pub cap_px: f32,
pub supersample: f32,
}Expand description
Per-font data kept in memory after init() so step() can build text quads each frame.
Fields§
§atlas_slot: usizeIndex into the backend’s text atlas texture array.
metrics: FontMetricsPer-glyph metrics keyed by Unicode code point.
atlas_w: u32Atlas width in pixels.
atlas_h: u32Atlas height in pixels.
size_px: f32Rasterisation height (px) used to position glyphs vertically.
cap_px: f32Cap height (logical px): the bearing of an uppercase reference glyph, used
to vertically center the visible text within its line box. The full em
(size_px) is taller than the visible glyphs, so centering on the em alone
leaves a gap above the caps; centering the cap band fixes that.
supersample: f32Atlas supersample factor: glyph atlas_w/atlas_h are stored in atlas
texels, which are this many times larger than the glyph’s size in logical
(layout) pixels. The on-screen quad divides by it so the text lays out at
its requested size while the extra texels supersample the glyph.