Open a font from bytes (which the text system keeps and frees).
- text: the text system to add the font to.
- data: the font file's bytes. The call takes ownership: it copies them and frees
data, even on failure. - name: a label for the font, copied.
ui := headless();
defer free_ui(*ui);
#import "File";
data := read_entire_file("fonts/Inter-Regular.ttf");
load_font_data(*ui.text, data, "Inter");This one is only checked to compile, not run.
load_font_data :: (text: *Text_System, data: string, name: string = "") -> bool
Open a font from bytes (which the text system keeps and frees).
Parameters
- text: *Text_System
- the text system to add the font to.
- data: string
- the font file's bytes. The call takes ownership: it copies them and frees
data, even on failure. - name: string = ""
- a label for the font, copied.
Returns
- bool
ui := headless();
defer free_ui(*ui);
#import "File";
data := read_entire_file("fonts/Inter-Regular.ttf");
load_font_data(*ui.text, data, "Inter");This one is only checked to compile, not run.