-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Is your feature request related to a problem? Please describe.
system-ui
does not guarantees that the mapped font is optimized for the page (content) language.
For instance, if the language of your OS is Japanese and you visit a simplified Chinese page (e.g. https://cn.vite.dev/), a Japanese font (Yu Gothic UI in Japanese Windows) is allocated at least in Windows:

It looks ugly especially as Chinese text.
- The font family is not unified. It lacks the glyph "历", so a different (native Chinese) font is used there and the weight differs than the other han characters.
- The shape of 置 and 版 are incorrect. They are Japanese forms (置 and 版). Note: their code points are identical!
If you remove system-ui
, you can get the intended glyph (look at 置 and 版) even in a Japanese OS:

A similar (vice versa) bug will occur if you visit a Japanese page that abuses system-ui
with a Chinese OS.
Also, Yu Gothic UI is not optimized for long text, which VitePress is designed to serve. It is overly optimized for cramming labels or relatively short descriptions into narrow spaces.
Microsoft YaHei UI seems to have narrower line height than the normal Microsoft YaHei.
Condition for font locale mismatch:
- The page abuses
system-ui
- The language of the page is one of CJK but different from that of OS
- The language of the page is not simplified Chinese or that of OS is not CJK
Describe the solution you'd like
Use sans-serif
instead of system-ui
. If both exists, If both are used, eliminate system-ui
. ui-sans-serif
is dedicated to macOS as for now.
If you do not like the Latin glyphs in common fonts mapped to system-ui
, add Segoe UI (Variable) or Apple system fonts.
It guarantees that it is the most readable font for the reader and matched to the OS language.
system-ui
is nothing but Apple's self-indulgence.
Describe alternatives you've considered
Stick to system-ui
It can look crappy for readers, contrary to Apple's intentions.
Additional context
Split out from #4927
https://infinnie.github.io/blog/2017/systemui.html
https://heistak.github.io/your-code-displays-japanese-wrong/
Validations
- Follow our Code of Conduct
- Read the docs.
- Read the Contributing Guidelines.
- Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.