Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Add Simplified Chinese translation #143

wants to merge 1 commit into from

Conversation

xlucn
Copy link
Contributor

@xlucn xlucn commented Oct 14, 2021

I am aware this has to wait for #137, hope it will be supported.

@agateau
Copy link
Owner

agateau commented Oct 15, 2021

Hi, thanks for this work! libgdx issues seem to imply it could work, but I need to try it out. Hopefully this weekend.

@agateau
Copy link
Owner

agateau commented Nov 6, 2021

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 agateau closed this Nov 6, 2021
@xlucn
Copy link
Contributor Author

xlucn commented Nov 6, 2021

@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?

@xlucn xlucn deleted the locale_zh_cn branch November 6, 2021 12:59
@agateau
Copy link
Owner

agateau commented Nov 7, 2021

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?

@xlucn
Copy link
Contributor Author

xlucn commented Nov 7, 2021

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.

@xlucn
Copy link
Contributor Author

xlucn commented Nov 8, 2021

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)!

@agateau
Copy link
Owner

agateau commented Nov 8, 2021

Wow, that's a massive size reduction! Going to open an issue to look into integrating this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants