natiny_font_set_filter
void natiny_font_set_filter(NatinyFont font, uint32_t min_filter,
uint32_t mag_filter);
Sets how the font's atlas is sampled.
Parameters
| Name | Type | Description |
|---|---|---|
font |
NatinyFont |
Font handle from natiny_font_create |
min_filter |
uint32_t |
NATINY_FILTER_LINEAR or NATINY_FILTER_NEAREST |
mag_filter |
uint32_t |
NATINY_FILTER_LINEAR or NATINY_FILTER_NEAREST |
Example
natiny_font_set_filter(pixel_font,
NATINY_FILTER_NEAREST, NATINY_FILTER_NEAREST);
Notes
NATINY_FILTER_LINEARis the default.- Anything that is not
NATINY_FILTER_NEARESTis taken asNATINY_FILTER_LINEAR. - The setting survives an atlas re-bake.
- Applies to this font's atlas only; a fallback font is filtered by its own setting.
- The atlas has no mip chain, so
min_filtermatters only where text is drawn smaller than it was baked.