ppresume / community

Discussions, feedbacks, roadmaps, community.
60 stars 3 forks source link

feat: support Chinese language #63

Closed xiaohanyu closed 3 months ago

xiaohanyu commented 3 months ago

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:

[Optional] Possible Solutions

NA

Acceptance Criteria

Todo list

NA

xiaohanyu commented 3 months ago

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:

image

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:

image
xiaohanyu commented 3 months ago

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:

image

So we decided to disable italics when mixing Chinese and English, and here is how it looks:

image

Looks better right?

xiaohanyu commented 3 months ago

Traditional Chinese has some different typesetting practices regarding to punctuations, check 繁体字实用指南(一) for more details, however, one notable thing is the layout of punctuations:

image

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:

image

The separator has different styles in different font/context.

disable kai font and use main font instead

Then we get the following doc:

image

Which I think looks much better.