memononen / nanovg

Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.
zlib License
5.07k stars 767 forks source link

Support for resetting fallback fonts. #560

Closed olliwang closed 4 years ago

olliwang commented 4 years ago

This commit adds nvgResetFallbackFontsId() and nvgResetFallbackFonts() functions for resetting fallback fonts. This would be very useful for improved CJK font support.

For example. If we always use an English-only font as the base font. We need to make sure the first fallback font is a Japanese font for Japanese articles or a Chinese font for Chinese articles. Right now there is no way to reset fallback fonts and thus the first assigned CJK font will be used across different languages.

memononen commented 4 years ago

Thanks again for the improvement!