-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Simplified Chinese translation #143
Conversation
Hi, thanks for this work! libgdx issues seem to imply it could work, but I need to try it out. Hopefully this weekend. |
Hi, it took me longer than expected, but I integrated your translation, and it looks like it works! At least to my Chinese-illiterate eyes. I created a new pull request (#155) because I had to make some changes to add a font with Chinese glyphs, so I am going to close this one, but your work is in. Can you check the builds from https://builds.agateau.com/pixelwheels/ and tell me if it looks like proper Chinese? |
@agateau Thanks a lot! I just tried, it's mostly good. But for Noto CJK fonts, the font file contains 5 family variants (slightly different details in characters), Simplified Chinese, Traditional Chinese, Hong Kong, Korean, and Japanese. The differences are minor, but very noticeable to CJK users, they are not wrong, though. The default(first) might be Japanese, or "Noto Sans CJK JP", thus, if there is a same character in Japanese and Chinese, it would be displayed in Japanese style even in Chinese language. So I am not sure if it is possible to specify one font family ("Noto Sans CJK SC") in addition to the font file? An alternative is using a Chinese-only font, like WenQuanYi, the pro is the file is smaller, but the con is there's only Chinese font, but no Korean or Japanese. Just out of curiosity, I noticed the apk file size got quite larger than the previous build, due to the new fonts files added. Since I don't see any user input throughout the app, maybe you can strip the font file to contain only the subset of glyphs in the app? |
Thanks for the feedback. Indeed the Noto CJK font makes the apk a lot larger. In WenQuanYi is as good as "Noto CJK" I think it makes sense to switch to it until there is a Korean or Japanese font. I am going to look into it. Regarding stripping the font file, that sounds like a good idea, but I have never tried that before (I do have a script to extract the required glyphs though). Do you know what tool to use to strip a font? |
Oh, I wanted to say that the wqy font only provides Chinese, there are certainly Japanese and Korean fonts out there. Doesn't matter here, though. If you use Python, fonttools module provide a command line tool pyftsubset to do that. Haven't tried it but the documentation shows it's quite esay to use. I don't know if there is anything need to worry about when using subsetted fonts (license or other things), never done any researches. |
Just tried (index 2 is "Noto Sans CJK SC", for the Simplified Chinese variant): pyftsubset /path/to/NotoSansCJK-Regular.ttc --text-file=/path/to/zh_CN.po --font-number=2 --output-file=NotoSansCJK-Regular.subset.otf The subset font file is just 100 KB (with 300+ glyphs)! |
Wow, that's a massive size reduction! Going to open an issue to look into integrating this. |
I am aware this has to wait for #137, hope it will be supported.