UI module

load_system_fonts

procedureextensionexperimentalsince 0.31.0Source

Load the platform's usual fonts: a sans font into slot 0, a monospace font into slot 1, then a few fallbacks for symbols and CJK. Any that are missing are replaced by synthetic fonts for the first two slots. The environment variables JAI_UI_FONT and JAI_UI_MONO_FONT name font files that replace the sans and monospace choices.

Example↗
ui := headless();
defer free_ui(*ui);
load_system_fonts(*ui.text);

This one is only checked to compile, not run.

load_system_fonts :: (text: *Text_System)

Load the platform's usual fonts: a sans font into slot 0, a monospace font into slot 1, then a few fallbacks for symbols and CJK. Any that are missing are replaced by synthetic fonts for the first two slots. The environment variables JAI_UI_FONT and JAI_UI_MONO_FONT name font files that replace the sans and monospace choices.

Parameters

text: *Text_System
the text system to fill.
Example↗
ui := headless();
defer free_ui(*ui);
load_system_fonts(*ui.text);

This one is only checked to compile, not run.

See also