natiny.font.set_filter
natiny.font.set_filter(font, min_filter [, mag_filter])
Sets how the font's atlas is sampled.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
font |
number |
Font handle from natiny.font.create |
|
min_filter |
number |
natiny.font.FILTER_LINEAR or natiny.font.FILTER_NEAREST |
|
mag_filter |
number |
min_filter |
natiny.font.FILTER_LINEAR or natiny.font.FILTER_NEAREST |
Example
natiny.font.set_filter(pixel_font, natiny.font.FILTER_NEAREST)
Notes
natiny.font.FILTER_LINEARis the default.- Omitting
mag_filterappliesmin_filterto both operations. - Values other than
natiny.font.FILTER_NEARESTselect linear filtering. - 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.