Skip to content

Conversation

tats-u
Copy link

@tats-u tats-u commented Oct 14, 2025

Description

system-ui has some problems on rendering CJK text especially long paragraphs like contents suitable for Vitepress. sans-serif may be an older font stack especially in Euro-American language, but does not have such problems.

Linked Issues

Fixes #4946

Additional Context

Before

Taken in Japanese Windows

Inappropriate / glyph & han characters with uneven thickness:

image

Too condensed and quirky hiragana & katakana:

image

After

image image

Future work

Additional font kerning settings may be preferred in headings and menus in Japanese (an additional PR).


Tip

The author of this PR can publish a preview release by commenting /publish below.


:root:where(:lang(zh)) {
--vp-font-family-base:
'Punctuation SC', 'Inter', ui-sans-serif, system-ui, sans-serif,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed? I think it's still needed because otherwise the punctuation will use Inter instead of Chinese font. 👀

Copy link
Author

@tats-u tats-u Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the punctuation will use Inter instead of Chinese font

Do you know which characters/code points are affected? I think it also occurs in Japanese and they should be removed from Inter if possible.
I suppose it is better to respect sans-serif there instead of using a custom font.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possible candidates:






Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these -

unicode-range:
U+201C, U+201D, U+2018, U+2019, U+2E3A, U+2014, U+2013, U+2026, U+00B7,
U+007E, U+002F;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the range of Inter is also defined by us. Let's add a new @font-face variant for CJK languages.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@tats-u tats-u Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

U+007E, U+002F

Do you know why they were added? I think they should be dedicated to zh(-Hans) if they remain.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

@tats-u tats-u Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it's the great clreq. It claims that it also covers traditional Chinese. I will follow it in both simplified and traditional Chinese.

@tats-u
Copy link
Author

tats-u commented Oct 15, 2025

image

It's (nearly) impossible to suppress this catch phrase to 2 lines. Yu Gothic UI (system-ui in Japanese Windows) can by the power of the extremely condensed hiragana & katakana. In the first place it is dedicated to Japanese Windows though.

image

Current:

した静的サイトジェネ
レーター

Best (if possible):

した静的サイト
ジェネレーター

@brc-dd
Copy link
Member

brc-dd commented Oct 15, 2025

Hmm, we can try word-break: auto-phrase with font-size: 48px 👀 Or if more customization is needed maybe a <wbr> in hero.text with word-break: keep-all.

With auto-phrase it looks like this on almost all sizes (in supported browsers):

image


Also, we likely will be updating the home page UI to be center-aligned similar to vue docs before hitting v2 stable.

@tats-u
Copy link
Author

tats-u commented Oct 16, 2025

word-break: auto-phrase

I will adopt it in Japanese. Also I will enable line-break: strict in CJK. (禁則処理/排版换行规则)

@tats-u
Copy link
Author

tats-u commented Oct 16, 2025

The current Firefox can enable text-autospace by a feature flag as opt-in.

image

You will not need to add a space between an alphanumeric character and a han/hiragana/katakana character for appearance sake anymore in latest browsers after several months.

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.

Prefer sans-serif to system-ui in default fonts

2 participants