Update default system font stack to better handle CJK locales on Windows#3729
Update default system font stack to better handle CJK locales on Windows#3729
Conversation
🦋 Changeset detectedLatest commit: b3af8d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for astro-starlight ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
size-limit report 📦
|
Very interesting! The Latin font change seems like an improvement aesthetically maybe? Hard to tell tbh. I’d be curious why it changes here, what the before/after fonts are, and whether we could/should handle them differently? |
Yeah, I am planning more investigations tomorrow morning but had to run for today. I'll share here my findings. Regarding the actual changes, difficult to say, but I think the "before" is closer to what I'm currently seeing on all other OS? |
|
After: (Japanese + Firefox + sans-serif = Source Han Sans VF ≒ Noto Sans CJK)
I think it's fine as long as it's within the scope of simple adjustments. FYI: (Windows + Chrome + additional manual adjustments (
We do not need to add these properties to this PR, I think. |
|
Firefox 147.0.4, Windows 11 25H2, zh-CN
I have fonts preferences default on browser except having mono font set to JetBrains Mono.
Microsoft YaHei is the default font for UI and texts in Simplified Chinese Windows systems. |
It is because Firefox has ridiculously declined to adopt Noto Sans CJK fonts unlike Chromium and is just a expected behavior. FYI, in Japanese sites, Meiryo (Firefox) or Noto Sans JP (Chromium) instead of Yu Gothic will be used after you install Japanese Supplemental Fonts: Add-WindowsCapability -Online -Name "Language.Fonts.Jpan~~~und-JPAN~0.0.1.0"This has already been installed in all Japanese Windows machines. While Yu Gothic is a high-quality font, it can be challenging to fully leverage its potential.
It depends on the browser's or OS's preferred languages. If no CJK language is in the list, a Simplified Chinese font, namely Microsoft YaHei (UI), will be assigned. In my environment, Japanese is at the top, so Yu Gothic UI is assigned instead. |
|
Endeavour OS seems to use the monolithic Noto Sans CJK font as the fallback CJK font in its UI. Linux-based OSes are not affected by this problem as long as they adopt Noto CJK fonts as their UI fonts. However, some cellphone manufacturers seem to adopt other Chinese-or-Japanese-dedicated fonts as UI fonts and trigger this bug. Do you know what fonts are designated for the sans-serif in Firefox and the default UI font in your Endeavour OS? Have you ever been changed them since install? |
|
Investigated a little bit more. First, to explain how it works on Linux (at least on EndeavourOS), is that the Current website The font used for the latin characters is "Noto Sans". With our previous font stack (before this PR), the first match found is <!--
system-ui
-->
<alias>
<family>system-ui</family>
<prefer>
<family>Adwaita Sasns</family>
<family>Cantarell</family>
<family>Noto Sans UI</family>
<family>Segoe UI</family>
<family>Segoe UI Historic</family>
<family>Segoe UI Symbol</family>
</prefer>
</alias>On a default EndeavourOS installation, the first installed font that matches this alias is "Noto Sans". Deploy preview The font used for the latin characters is "Liberation Sans". With the new font stack (from this PR), the first match found is <!-- Microsoft -->
<alias binding="same">
<family>Arial</family>
<accept>
<family>Arimo</family>
<family>Liberation Sans</family>
<family>Albany</family>
<family>Albany AMT</family>
</accept>
</alias>On a default EndeavourOS installation, the first installed font that matches this alias is "Liberation Sans" and as Following that logic, I also tested installing Chrome on EndeavourOS and the behavior is the same: the difference is also visible and the same font are used before and after compared to Firefox. |
|
I see. I think Arial could be stripped or less of a priority nowadays. (Windows → Segoe UI / Apple → -apple-system) |
@tats-u Is this in the deploy preview? So it’s a problem with this PR? |
|
This is an expected behavior in the Preview of this PR. It is a Chinese page. |
Oh, great, perfect — thank you! Confused myself after looking at so many screenshots 😄 Thank you to everyone who has been sharing. It is very helpful! |
|
Here are more results following the change from 069ec02:
Sharing here screenshots of the visual change observed in Firefox and Chrome on the Ubuntu 24.04.4 virtual machine:
In this case, this is explained by Ubuntu/Gnome overriding |
This seems like an acceptable change I guess? In theory, we could add Ubuntu Sans to the font stack, but I did a quick search and this does not seem to be a common thing people do, so probably not necessary. |
|
It would be endless if we were to list every default UI font for each OS individually. |
From the quick research I did, yeah, I came to the same conclusion and I think this may be acceptable. |
|
The font in zh-cn looks great together |
|
@liruifengv What is your OS? Have you tweaked the font config in your browser? Probably it's the behavior I expect. |
MacOS and Windows. I don't remember if I changed the font. |
|
@liruifengv Thank you. It is the behavior that we exactly expect.
Probably you have not changed them. Noto is default in Chromium-based browsers if installed. Windows bundles Noto fonts that match with your language. Those of the other languages are required to be manually appended: https://learn.microsoft.com/windows/deployment/windows-missing-fonts?pivots=windows-11 (Noto are not listed there but probably included) |
HiDeoo
left a comment
There was a problem hiding this comment.
After all this testing, I think we've landed up on a great set of changes providing good improvements.
Thanks everyone for all the tests and feedback 🙌


















Description
system-ui#3721-apple-systemandBlinkMacSystemFontfonts and removing the newersystem-uiandui-sans-seriffamilies.Todo
We should try to test on a broad range of browsers and devices:
macOS
Windows
iOS
Linux
Android
I would love help testing this! I don’t have Windows/Linux boxes to test on personally. And testing on machines in CJK locales would be particularly useful.
To test, you can compare the deploy preview for this PR with the live Starlight docs. Check if appearance of fonts change in multiple languages and note any differences if there are any.