feat: support Chinese language
Closed this issue · 3 comments
Description
As part of the plan to support CJK resumes, Chinese would be the first language to support. Besides simple translations for section names, language fluency options, etc, there're some additional rules that need to be respected:
- datetime localization
- respect CJK typesetting best practices
- guidelines from Google fonts
- Requirements for Chinese Text Layout
[Optional] Possible Solutions
NA
Acceptance Criteria
- support both Simplified and Traditional Chinese
Todo list
NA
We got some issues when supporting traditional Chinese as the default ctex package on Ubuntu use gkai00mp.ttf: AR PL KaitiM GB,文鼎PL简中楷:style=Regular
for kai font:
\setCJKfamilyfont { zhkai } { gkai00mp.ttf }
However, 學
and 績
are missing in gkai00mp.ttf
, so you will get something like:
with warnings like:
Missing character: There is no 學 (U+5B78) in font AR PL KaitiM GB/OT:script=han
i;language=dflt;!
Missing character: There is no 績 (U+7E3E) in font AR PL KaitiM GB/OT:script=han
i;language=dflt;!
To overcome this issue, we can use bkai00mp.ttf: AR PL KaitiM Big5,文鼎PL中楷
as kai font for traditional Chinese, then we have to set different fonts for Simplified Chinese and Traditional Chinese, even with this approach, we cannot guarantee that people won't type Simplified Chinese and Traditional Chinese at the same time and still got some missing characters.
After some investigation, we decided to apply Noto Serif and Noto Sans as the default font for CJK resumes, now we are able to support both Simplified and Traditional Chinese resumes, preview:
Another issue is that in Chinese typesetting, it is generally not suggested to use italic font, however, italics in English is common, when mixing English and Chinese with italics, it looks not good:
So we decided to disable italics when mixing Chinese and English, and here is how it looks:
Looks better right?
Traditional Chinese has some different typesetting practices regarding to punctuations, check 繁体字实用指南(一) for more details, however, one notable thing is the layout of punctuations:
As you can see, traditional Chinese put comma/colon in the middle, while simplified Chinese put them in the bottom left, which is more aligned with English typesetting. And if we mixed traditional Chinese and English, then the style would look very weird, check the following pic:
The separator has different styles in different font/context.
disable kai font and use main font instead
Then we get the following doc:
Which I think looks much better.