UI module

get_glyph

procedureextensionexperimentalsince 0.31.0Source

The glyph for code in a font slot at size points, rasterized into the atlas on first use. Falls back through the later fonts when the slot's font has no glyph for it.

Example↗
ui := headless();
defer free_ui(*ui);
glyph := get_glyph(*ui.text, #char "A", .SANS, 16);

This one is only checked to compile, not run.

get_glyph :: (
    text: *Text_System,
    code: u32,
    slot: Font_Slot,
    size: float
) -> Glyph

The glyph for code in a font slot at size points, rasterized into the atlas on first use. Falls back through the later fonts when the slot's font has no glyph for it.

Parameters

text: *Text_System
the text system holding the fonts and atlas.
code: u32
the code point.
slot: Font_Slot
which font to prefer.
size: float
the font size in points.

Returns

Example↗
ui := headless();
defer free_ui(*ui);
glyph := get_glyph(*ui.text, #char "A", .SANS, 16);

This one is only checked to compile, not run.

See also