natiny.font.get_atlas
natiny.font.get_atlas(font) -> texture
Returns the texture the font's glyphs are baked into.
Parameters
| Name | Type | Description |
|---|---|---|
font |
number |
Font handle from natiny.font.create |
Returns
| Type | Description |
|---|---|
number or nil |
Atlas texture handle, or nil for an invalid font |
Example
local atlas = natiny.font.get_atlas(font)
natiny.render.texture(atlas, 0, 0, 256, 256)
Notes
- The font owns the texture. Do not pass it to
natiny.texture.destroyor modify it withnatiny.texture.update. - Glyphs are added on demand. A display-scale change may replace the atlas
contents, invalidating coordinates returned by
natiny.font.get_glyph.