natiny_font_preload
void natiny_font_preload(NatinyFont font, const char* text);
Rasterizes every glyph the text uses now, instead of on the frame that first draws it.
Parameters
| Name | Type | Description |
|---|---|---|
font |
NatinyFont |
Font handle from natiny_font_create |
text |
const char* |
Null-terminated UTF-8 text whose glyphs to bake |
Example
NatinyFont font = natiny_font_create(res, 24.0f);
natiny_font_preload(font, "Play Settings Quit");
Notes
- A glyph is normally baked when first drawn. Preloading moves rasterization and atlas upload to the call site.
- Line breaks and tabs in
textare skipped; they have no glyph. - Follows the fallback chain.
- Invalid handles and
NULLtext are ignored.