UI module

load_font

procedureextensionexperimentalsince 0.31.0Source

Open the font file at path into the next slot. Returns false when it cannot be read or parsed.

Example↗
ui := headless();
defer free_ui(*ui);
if !load_font(*ui.text, "fonts/Inter-Regular.ttf") print("font missing\n");

This one is only checked to compile, not run.

load_font :: (text: *Text_System, path: string) -> bool

Open the font file at path into the next slot. Returns false when it cannot be read or parsed.

Parameters

text: *Text_System
the text system to add the font to.
path: string
the font file to read.

Returns

bool
Example↗
ui := headless();
defer free_ui(*ui);
if !load_font(*ui.text, "fonts/Inter-Regular.ttf") print("font missing\n");

This one is only checked to compile, not run.

See also