Create a mapping from script to font language#767
Merged
Conversation
jwiggins
commented
Apr 6, 2021
Comment on lines
+41
to
+48
| # Pick a language to use for "Han" script | ||
| han_lang = "Traditional Chinese" # Default | ||
| if locale_lang in ("zh_CN", "zh_SG"): | ||
| han_lang = "Simplified Chinese" | ||
| elif locale_lang.startswith("ja"): | ||
| han_lang = "Japanese" | ||
| elif locale_lang.startswith("ko"): | ||
| han_lang = "Korean" |
Member
Author
There was a problem hiding this comment.
Having played with this a bit more, we should only use this choice when it's not otherwise clear from the context. For instance if a string already contains Hiragana or Katakana, then Han should be mapped to "Japanese". If Hangul is encountered, Han maps to "Korean". Only if the Han is mixed with some non-CJK language should we fall back to this locale-based guess.
Member
Author
|
Thanks for the review |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is another step for #762
The PR adds support for converting the script name generated by
UnicodeAnalyzerand mapping it to a language name which a font reports support for.