natiny_font_preload

C
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

C
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 text are skipped; they have no glyph.
  • Follows the fallback chain.
  • Invalid handles and NULL text are ignored.