Ascent, descent and line height of a font slot at size points.
- text: the text system holding the fonts.
- slot: which font to measure.
- size: the font size in points.
ui := headless();
defer free_ui(*ui);
metrics := font_metrics(*ui.text, .SANS, 20);
assert(metrics.line_height > 0);font_metrics :: (
text: *Text_System,
slot: Font_Slot,
size: float
) -> Font_Metrics
Ascent, descent and line height of a font slot at size points.
Parameters
- text: *Text_System
- the text system holding the fonts.
- slot: Font_Slot
- which font to measure.
- size: float
- the font size in points.
Returns
ui := headless();
defer free_ui(*ui);
metrics := font_metrics(*ui.text, .SANS, 20);
assert(metrics.line_height > 0);