natiny.font.get_atlas
Lua
natiny.font.get_atlas(font) -> texture
Returns the texture the font's glyphs are baked into.
Parameters
Returns
| Type |
Description |
number or nil |
Atlas texture handle, or nil for an invalid font |
Example
Lua
local atlas = natiny.font.get_atlas(font)
natiny.render.texture(atlas, 0, 0, 256, 256)
Notes
- The returned handle is compatible with texture and render APIs.
- The texture contains white glyphs with alpha coverage, so rendering it is
tinted by the current draw color.
- The font owns the texture. Do not pass it to
natiny.texture.destroy or modify it with
natiny.texture.update.
- Glyphs are added on demand. A display-scale change may replace the atlas
contents, invalidating coordinates returned by
natiny.font.get_glyph.
- A fallback font has an atlas of its own; this returns only this font's.