natiny_font_set_fallback
void natiny_font_set_fallback(NatinyFont font, NatinyFont fallback);
Names another font to draw the code points this one has no outline for.
Parameters
| Name | Type | Description |
|---|---|---|
font |
NatinyFont |
Font handle from natiny_font_create |
fallback |
NatinyFont |
Font used for missing glyphs; 0 clears the fallback |
Example
NatinyFont latin = natiny_font_create(roboto, 24.0f);
NatinyFont emoji = natiny_font_create(noto_emoji, 24.0f);
natiny_font_set_fallback(latin, emoji);
natiny_render_text(latin, 10.0f, 10.0f, "Ready \xF0\x9F\x9A\x80");
Notes
- Resolution is per code point, and measuring follows the same chain as drawing.
- A fallback may have its own fallback. Resolution follows at most eight fonts.
- A font cannot be its own fallback; that call is ignored, as is a handle that names no live font.
- Kerning does not cross the boundary between two faces.
- Destroying the fallback quietly ends the arrangement.
- Font sizes are independent.