UI module

glyph_advance

procedureextensionexperimentalsince 0.31.0Source

Horizontal advance of one code point in points (a tab is four spaces).

Example↗
ui := headless();
defer free_ui(*ui);
assert(glyph_advance(*ui.text, #char "a", .{ size = 10 }) == 6);
glyph_advance :: (text: *Text_System, code: u32, style: Text_Style) -> float

Horizontal advance of one code point in points (a tab is four spaces).

Parameters

text: *Text_System
the text system holding the fonts.
code: u32
the code point.
style: Text_Style
the font and size to measure with.

Returns

float
Example↗
ui := headless();
defer free_ui(*ui);
assert(glyph_advance(*ui.text, #char "a", .{ size = 10 }) == 6);

See also