natiny.font.preload_range

Lua
natiny.font.preload_range(font, first, last)

Rasterizes every glyph in a range of code points.

Parameters

Name Type Description
font number Font handle from natiny.font.create
first number or string First Unicode code point, or a UTF-8 string whose first character is used
last number or string Last Unicode code point, inclusive, or a UTF-8 string whose first character is used

Example

Lua
natiny.font.preload_range(font, 0x0410, 0x044F)   -- Cyrillic

Notes

  • The endpoints are inclusive and are swapped when last is less than first; the upper endpoint is clamped to U+10FFFF.
  • A code point the face has no outline for costs an entry in the glyph table and no atlas space, so a generous range is cheap in pixels and not free in memory. Prefer natiny.font.preload when the strings are known.