natiny_font_get_atlas
NatinyTexture natiny_font_get_atlas(NatinyFont font);
Returns the texture the font's glyphs are baked into.
Parameters
| Name | Type | Description |
|---|---|---|
font |
NatinyFont |
Font handle from natiny_font_create |
Returns
| Type | Description |
|---|---|
NatinyTexture |
Texture handle, or 0 for an invalid font |
Example
NatinyTexture atlas = natiny_font_get_atlas(font);
natiny_render_texture(atlas, 0.0f, 0.0f, 256.0f, 256.0f);
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.