Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support for resetting fallback fonts. #560

Merged
merged 1 commit into from
Feb 28, 2020
Merged

Conversation

olliwang
Copy link
Contributor

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.

src/fontstash.h Outdated
@@ -797,6 +797,17 @@ int fonsAddFallbackFont(FONScontext* stash, int base, int fallback)
return 0;
}

void fonsResetdFallbackFont(FONScontext* stash, int base)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra D:
fonsResetdFallbackFont

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Just fixed the typo. :)

This commit adds `nvgResetFallbackFontsId()` and `nvgResetFallbackFonts()` functions for resetting fallback fonts.
@memononen memononen merged commit 492df63 into memononen:master Feb 28, 2020
@memononen
Copy link
Owner

Thanks again for the improvement!

@olliwang olliwang deleted the font branch December 3, 2021 04:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants