natiny.font.preload_range
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
natiny.font.preload_range(font, 0x0410, 0x044F) -- Cyrillic
Notes
- The endpoints are inclusive and are swapped when
lastis less thanfirst; the upper endpoint is clamped toU+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.preloadwhen the strings are known.