natiny.font.has_glyph
Lua
natiny.font.has_glyph(font, codepoint) -> boolean
Answers whether this font can draw a code point, following its fallback chain.
Parameters
| Name |
Type |
Description |
font |
number |
Font handle from natiny.font.create |
codepoint |
number or string |
Unicode code point, or a UTF-8 string whose first character is tested |
Returns
| Type |
Description |
boolean |
true if the font or one of its fallbacks provides the glyph |
Example
Lua
local can_draw = natiny.font.has_glyph(font, "中")
Notes
false means the code point would be drawn as the missing-glyph box.
- An empty or malformed string raises a Lua error.