-
-
Notifications
You must be signed in to change notification settings - Fork 558
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
chore: add Simplified Chinese translation #89
Conversation
Thank you very much! |
It seems really good. If you have other monospaced fonts (available both as lite and bold) to suggest, feel free to do it in the meantime. |
In the long run, I think it is recommended to add support for font settings, allowing users to set their favourite font. I'm not familiar with iced so I'm afraid there's little I can help with. Monospaced fonts which include Chinese characters are really rare. LXGWWenKai Mono series also support traditional Chinese and Japanese. I do think it's the best choice. |
Another important concern is that the fonts including all the Chinese glyphs are pretty heavy in size, but I guess this cannot be avoided since they must include thousands of characters. |
What concerns is that we don't know when will iced finish the development of text shaping and font fallback, as it's really a breaking change for iced. I'm going to look into how to minify font files. |
An easy first step to take is to remove all the traditional Chinese characters. I think that simplified Chinese is by far more common, if you can confirm. |
Can you please give a look at this table? |
Nevermind, I think the best solution is using something like this to keep only the glyphs actually used. So the plan is: load the full ttf files, and every time a new language/new phrases are added filter only the used characters and duplicate the font keeping only the needed glyphs. |
TL;DRCJK Unified Ideographs: U+4E00 - U+9FCB I used English punctuation marks in Chinese translation. So we currently don't need Chinese punctuation marks. Ref: https://www.cnblogs.com/hookjc/p/13178791.html Some related information:Due to the influence of Chinese culture, East Asian countries contain some Chinese characters (such as Japanese and Korean) in their languages. The Unicode working group decided to merge the Chinese characters in the Chinese, Japanese and Korean languages into the unified ideographic characters of China, Japan and Korea (CJK, The initials of the three languages of China, Japan and Korea). If someone provides a Japanese translation, please refer to https://stackoverflow.com/questions/19899554/unicode-range-for-japanese All
I'm afraid that it's a little hard to split Simplified Chinese characters from all Chinese characters. Let's try to keep all the characters in
Sounds good! Any more problems on Simplified Chinese translation please feel free to ask me. I may reply a bit late for my busy study works. |
Thank you very much for the detailed answer. |
A brief recap:
|
I tried the branch |
Unfortunately, the maintainer of LXGW directly rejected our request on the grounds that his technical ability is insufficient, etc. lxgw/LxgwWenKai-Lite#5 (comment). Well, shall we try combining two different fonts, while one of them includes Chinese characters, into the same font? Or we may have to wait until iced finishes the development on font fallback. |
Thanks for the kind words. I also asked the maintainer of iced and he said me that the current renderer has this limitation on light backgrounds and currently there is not a proper solution. The best solution for now would be to find another complete font as LXGW but bolder, with all the characters we need for the different languages. |
OK. I will try searching for other fonts. And I created an issue telling anyone who needs Chinese translation can temporally using my pre compiled executable file. |
Awesome, thanks |
I would suggest using Sarasa Gothic (specifically Sarasa Mono) for CJK coding usage. Wenkai is a modulated handwritten typeface and does not fit well with slab serif monospaced fonts. |
Nice, thanks for the suggestion! |
Hinted version is probably for Windows ClearType. For version used, quote from original:
Any of these three should work, for Chinese em dashes should be full width, but depending on use case half width are acceptable (including coding). Use SC version for Simplified Chinese and CL for Traditional Chinese. TC/HC are weird and not region-agnostic, so I would suggest against using those. |
Considering only sarasa-mono there are:
|
The slab version probably doesn't match Inconsolate, so I'd suggest |
Note that I would like to use just one font type. So ideally, I would have to use sarasa-mono for all the languages. |
It is impossible to do so for CJK (Simplified Chinese/Traditional Chinese/Japanese/Korean) as there is the problem of Han unification: each CJK locale must have their own font to display the correct Han character. |
I will try sarasa-mono-slab-sc (since after having a look at both I prefer the slab version) and I will let you know. |
I ended up choosing the non slab version. The bold version is well visible on light backgrounds. |
Just to remind, it you plan to use Sarasa fonts with Latin usage, the Term version will be more suitable compared to Mono as the em dash is also used in Latin too. |
Is the em dash the only relevant difference? |
@all-contributors please add @cxw620 for translation. |
I've put up a pull request to add @cxw620! 🎉 |
chore: add Simplified Chinese translation
Well,
iced-rs
currently has no font fallback, when font is set to beFont::Default
, Chinese can still not be displayed:INCONSOLATA_BOLD which sniffnet takes with, doesn't support Chinese as well.
We can only choose fonts that support Chinese and English, etc, as much as possible. So a new font
LXGWWenKaiMonoLite
was introduced by me and it works really well on styleYeti Day
andMon Amour
. However, since font itself may be part of a specific style, I don't know if it's accepted.Related codes:
Details of
LXGWWenKaiMonoLite
can be found here: https://github.com/lxgw/LxgwWenKai-Lite