w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.52k stars 672 forks source link

[css-fonts] `system-ui` behavior is undesired for some users #3658

Open kojiishi opened 5 years ago

kojiishi commented 5 years ago

From crbug.com/554590#c21, github, Bootstrap, and Wikipedia decided to stop using the system-ui font family because the visual quality of their pages is suffered on some OS/language combinations.

Context reported in the issue above:

litherum commented 5 years ago

One of two things is true:

  1. The Windows system font really is terrible in some situations
  2. The browser implementation of the system font doesn't match the platform
Malvoz commented 5 years ago

Why is this a CSSWG issue? Does the spec need clarification or is this a suggestion for deprecation?

The blog post mentions a couple of things:

It turns out that the value of system-ui in fact not only depends on the version of the current OS [...]

Why would one expect all OS versions to render the same font? That is no different to using a "system font stack"-hack.

It could be good to use the OS font to provide the user with a native look and feel, but on Windows, the font family used for UI changes with the language it is in, as well as the theme used.

[...] on Windows 8.1/Windows 10 in Simplified Chinese, the system-ui font family evaluates to Microsoft YaHei UI, which, it turns out, not only lacks many font weights that Segoe UI has (say semibold), but has letters and numbers a little larger and bolder to match the Chinese text than what could have been designed with.

Not all fonts support all languages, which is unfortunate and an issue with the rendered font.

On Windows Vista/Windows 7 and corresponding Windows Server versions, with the Windows Classic theme turned on, one might see the good decades-old Tahoma/SimSun/PMingLiU… for system-ui to evaluate to (replicated on Windows Server 2008 R2 in Simplified Chinese).

The rendered font is considered undesired, that'd be an issue for that OS version?

kojiishi commented 5 years ago

I guess we need to solve this when we add more system font families.

@litherum

One of two things is true:

  1. The Windows system font really is terrible in some situations
  2. The browser implementation of the system font doesn't match the platform

I’m afraid I don’t understand what you’re suggesting. Can you please expand? I agree 1 is true. I’m not sure what 2 means, and I’m not sure what you suggest from these two.

@Malvoz

Why is this a CSSWG issue? Does the spec need clarification or is this a suggestion for deprecation?

One of the original motivations of system-ui is to deprecate non-standard vendor-specific values (-apple-system and BlinkMacSystemFont) and we thought what the spec currently defines can help it:

This generic font family lets text render with the default user interface font on the platform on which the UA is running.

However, github, medium, bootstrap, and wikipedia considered that this definition isn’t what they want for Chinese Windows, and that they’re back to the vendor-specific values because they provide what they want. True that this is Windows specific problem, but if people stops using system-ui and stick to non-standard values due to the problem, isn’t it our failure?

Blink can fix this. I’m hoping to solve this somehow, make system-ui usable, and deprecate our vendor-specific value. But 1) I wanted to note that it will no longer “the default UI fonts on the platform” in some cases, and 2) I would like to sync with other browsers on Windows. /cc @atanassov @emilio

AmeliaBR commented 5 years ago

Koji, what particular change are you requesting for the CSS definition of system-ui?

In general, I think user agents should have flexibility to select the font(s) to use, even if it doesn't always match the System UI. And we already have text in Fonts 4 allowing the generic font keywords to map to composite fonts that consist of different fonts for different languages. But, if cross-browser consistency on a given platform is important, then we might need stricter guidance than that.

litherum commented 5 years ago

If the Windows system font really is ugly in Chinese, what do Chinese native apps do?

kojiishi commented 5 years ago

If the Windows system font really is ugly in Chinese, what do Chinese native apps do?

They just live with the fonts. The difference is that, those apps are in Chinese and that no other choices are available to render Chinese characters. On the other hand, they were seeing much better fonts when they visit github and other English content sites. But with system-ui, all such contents were downgraded to the Chinese fonts too.

Japanese is in similar situation, and I was under impression that users/authors prefer native fonts, even though it looks worse. The feedback revealed that I was wrong. They preferred English system fonts, no matter which language their platform is in, at least for English contents.

We probably need to hard-code the name of English system fonts, and pick it instead of the actual default UI fonts under some conditions. I haven't finalized the exact heuristic yet, I'll think about it more.

In general, I think user agents should have flexibility to select the font(s) to use, even if it doesn't always match the System UI.

Oh, really, great if so, thank you. The definition of system-ui didn't read so to me, but my English isn't great, so I trust your reading.

If the spec text already allows UA to pick other arbitrary fonts than "the default user interface font on the platform", this might not be a spec issue. I can investigate how to make authors happy, and may sync with @atanassov and @emilio outside the WG.

NightFurySL2001 commented 2 years ago

I would argue that the current implementation of system-ui is on point and should be kept that way; the issue pointed out by https://infinnie.github.io/blog/2017/systemui.html is a non-issue.

On Windows Vista/Windows 7 and corresponding Windows Server versions, with the Windows Classic theme turned on, one might see the good decades-old Tahoma/SimSun/PMingLiU… for system-ui to evaluate to (replicated on Windows Server 2008 R2 in Simplified Chinese).

What this section missed in context is that, the system font itself is also changed (to the uglier but clearer bitmap font, which is SimSun for Simplified Chinese system) when the theme changed, so what system-ui evaluates to be does indeed match the current system font. The following provides screenshots for the actual Windows 7 system, please notice the font used by the file names on the desktop and Windows Explorer.

Windows 7 Aero theme, using Microsoft YaHei: Aero theme Windows 7 Classic theme, using SimSun: Classic theme

`index.html` source code ```html Testing text using system-ui. This page is displayed with Google Chrome. ```

This is an "issue" with Windows rendering engine, not with the CSS specs. Display for CJK (and corresponding Latin text in their languages) has been using bitmap fonts for a long time, and in places where clarity is required, using bitmap font is better than using newer system fonts (considering there is still a relatively large CRT moniter user group in China).

If the Windows system font really is ugly in Chinese, what do Chinese native apps do?

On Windows 7 and earlier, there are two ways:

  1. keep the original system font (or don't specify in software), which uses SimSun if using the Classic theme
  2. hardcode the new system font (Microsoft YaHei) in software, which will not change when changing theme

I am unable to test on Windows 8 and later due to single display language pack limitation, but I would guess the High Contrast settings might result in the same behaviour (Chinese font reverted to bitmap font, i.e. SimSun/PMingLiU for high contrast theme for display clarity).

Do be noted that this "issue" only arises when the user voluntarily choose to use the Classic theme (Windows 7 & lower)/High Contrast settings (Windows 8 & higher), which is a correct response as the user might intend to use the theme/settings for their individual requirements. We as developer should in no way work against the choices users had made, even though it might look worse for us (but not them).

Thus, my conclusion is: 1. The Windows system font really is terrible in some situations, but intended. There is no reason to stop using/implementing system-ui, and with Firefox adding support in August 2021 (https://github.com/mdn/content/issues/7751), there is literally nothing stopping the usage of system-ui.

fireattack commented 2 years ago

It's not just the SimSun being terrible; MS YaHei is also terrible for displaying Latin characters (among lots of other things, like Japanese Kana), which was why as mentioned above, GitHub, Bootstrap, Wikipedia, and later Stack Overflow, all had to roll back from using it due backslash from the community.

Go and add system-ui in CSS on GitHub to your Chinese Windows VM and check this very page again to see how it looks.

Is it "intended"? Yes it is. But in the ideal world the intended use should give somewhat good result. It doesn't matter which end is causing the issue, at the end the website designer is the one who has to deal with it.

There is no reason to stop using/implementing system-ui

If you as a dev care about (Chinese) Windows users, you still have to think twice about using system-ui font. Plenty of Chinese users read English websites. "That's because Windows is shit" isn't going to help anyone.

And keep in mind it is a "regression" in term of user experience. The current stack of -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji" can at least generate good result (Segoe UI) for these users (without sacrificing other users).

NightFurySL2001 commented 2 years ago

@fireattack The Latin characters in Microsoft YaHei comes from Segoe UI (of Windows 7), just slightly enlarged. I don't think it looks terrible; in fact, comparing it to the original Segoe UI it is way more legible due to its increased font size.

For the benefit of doubt, I have also tried out Traditional Chinese (Microsoft JhengHei) which also is based on Segoe UI. It did not make too much of a difference too. Both Chinese variants only had "issue" when using Windows 7 Classic theme.

Following are attached screenshots from my Windows 7 work machine, with UI language English, Simplified Chinese and Traditional Chinese, all 3 presented using both Aero theme and Classic theme:

Expand for screenshot ## English ### Aero Evals to Segoe UI. ![en-aero](https://user-images.githubusercontent.com/33471049/192552691-3592c772-1b4f-4a59-9995-578872e46f1b.png) ### Classic Evals to Tahoma. ![en-classic](https://user-images.githubusercontent.com/33471049/192552716-2759f4f8-96fd-4fb4-80f3-1bf44e435baf.png) ## Simplified Chinese ### Aero Evals to Microsoft YaHei. ![zhs-aero](https://user-images.githubusercontent.com/33471049/192552935-6830ec66-4c0b-4dbf-8a42-9d012f2d89b0.png) ### Classic Evals to SimSun. ![zhs-classic](https://user-images.githubusercontent.com/33471049/192552940-e892fe1a-7094-468c-964d-8517c7145891.png) ## Traditional Chinese ### Aero Evals to Microsoft JhengHei. ![zht-aero](https://user-images.githubusercontent.com/33471049/192552945-a6930d49-11bf-409c-9278-cb4a66780400.png) ### Classic Evals to PMingLiU. ![zht-classic](https://user-images.githubusercontent.com/33471049/192552949-5dbd3840-7624-43e1-bb0e-e3a8734fac24.png)

GitHub, Bootstrap, Wikipedia, and later Stack Overflow, all had to roll back from using it due backslash from the community.

Please note: most of these sites changes reference the only one "issue" regarding system-ui: https://infinnie.github.io/blog/2017/systemui.html on GitHub (GitHub Primer CSS, Bootstrap [note that the issue author is the same as the blog post author - conflict on interest], Wikipedia), which only "affects" Simplified Chinese, Classic theme, Windows 7 users. It should be in no way that such a minority group should be allowed to direct most of the users to stop using system-ui just because the font rendering is bad for their language in one old settings, ignoring all the other benefits of using system-ui.

Is it "intended"? Yes it is. But in the ideal world the intended use should give somewhat good result. It doesn't matter which end is causing the issue, at the end the website designer is the one who has to deal with it.

Please note that what system-ui is not for giving good result, it is to integrate with the look and feel of the native OS (https://drafts.csswg.org/css-fonts-4/#system-ui-def). It is just faithfully reproducing what the user had already been using on their native OS, regardless of the font choice. If the designer doesn't like it, do stop using system-ui, but they're just missing on the chance to localize to the users correctly.

And keep in mind it is a "regression" in term of user experience. The current stack of -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji" can at least generate good result (Segoe UI) for these users (without sacrificing other users).

Do note that this will make Windows 7 Classic theme (pointed in "the issue") display the wrong font: it should have been Tahoma, not Segoe UI.


When I was in discussion with GitHub when they naively added Meiryo to the font stack (overriding Chinese text too), the devs have mentioned that they would very much like to use system-ui, including if the user chose to use a serif font, but is blocked only due to "the issue". Quote:

Why prioritise system-ui over ui-sans-serif? If the system is using, say, a serif font as the system font, would Primer really want to use that?

AFAIK, Primer tries to stay as close to the default system font as possible. So I would say yes.

GitHub Primer's response so far is to allow users to write their own font family stack.


Mentioed in https://infinnie.github.io/blog/2017/systemui.html:

the system-ui font family evaluates to Microsoft YaHei UI, which, it turns out, not only lacks many font weights that Segoe UI has (say semibold), but has letters and numbers a little larger and bolder to match the Chinese text than what could have been designed with

I acknowledge that this is an issue on Windows, but do note that this issue also affect other languages and systems too.

On Windows, Traditional Chinese uses Microsoft JhengHei, which has an even worse Bold weight compared to Simplified Chinese Microsoft YaHei. Both Chinese fonts come with 3 weight: Light, Regular, Bold. Following is a rough font weight comparison for both Chinese fonts (hanzi only) relative to Segoe UI (italic are new weights not in Windows 7):

image

Meiryo for Japanese isn't anywhere good; it only have 2 weights: Regular and Bold.

On Mac side of things, the Chinese font PingFang comes in Simplified Chinese (China), Traditional Chinese (Taiwan), and Traditional Chinese (Hong Kong), each comes with 6 weights. However, the weights provided are (source (2)):

中文 英文 FontWeight值
苹方-简 极细体 PingFangSC-Ultralight w100
苹方-简 纤细体 PingFangSC-Thin w200
苹方-简 细体 PingFangSC-Light w300
苹方-简 常规体 PingFangSC-Regular w400 or normal
苹方-简 中黑体 PingFangSC-Medium w500
苹方-简 中粗体 PingFangSC-Semibold w600

Its Semibold isn't even reaching Bold weight of SF Pro.

Only Japanese text is remotely good on Mac: Hiragino Sans comes with W0-W9, matching closely with SF Pro's weights.

It's way better on Android (and some Linux) side: Noto Sans CJK comes with 7 weights, roughly matching Roboto's 6 weights. Also, all CJK regions uses the same font design, which is a plus when using system-ui since there is no discrepency between different localization.

Point is, CJK fonts have been quite a pain on system vendors due to its pricey nature. "lacking many font weights" is definitely not a factor when considering a design to match user's system: there's only that many weights on all these OS, and OS fonts are limited to the same set of weights too. The burden of system-ui being "ugly" is on OS vendor on this issue. Website developers will be better off hard coding the best font for their own locale (which might be an issue; see next point) instead of relying on system-ui if they want a "good result" instead of "system default". Note that "system default" ∌ "good result" outside of Latin text.


Also, there is additional benefits such as correctly localizing the font for the users, especially towards CJK users. Let me demonstrate: the following is a text typesetted in Microsoft YaHei (SC), Microsoft JhengHei (TC), Meiryo (JP):

image

Notice the following characters: , , , , . These characters are written differently in different languages/regions due to an issue: Han unification. By using system-ui and correct user localization settings (which most Chinese users do), this above issue is mitigated by using the correct font stack to display CJK Unified Ideographs, and preventing display of incorrect localization. Using sans-serif does not come with this benefit as it uses the default font fallback regardless of system locale settings, which on Windows prioritise Japanese over Chinese and leading to more issues than of broken Latin text. Hard-coding the font stack will only work if you're targeting one specific locale, as you will be required to order the priority of fonts. Most Chinese users will appreciate "correct writing form" more over "looking good".

The locale settings in system-ui doesn't only help CJK, it might help with other locales too (e.g. different italic forms of Cyrillic).

Ignore this point if your website has correct language tagging: <html lang="zh-hans">/zh-hant/ja will fix the font for sans-serif most of the time. If your (or user-generated) content does not have any language information, system-ui is the better bet for localization.

As I said, no reason to stop using system-ui for just some "ugly" display due to poor system font (and user) choice.

TL;DR: The issue mentioned in https://infinnie.github.io/blog/2017/systemui.html is a non-issue as it isn't what system-ui tries to achive: providing the native OS feel that the user already had on their machine. Developers can note the one minor consequence for the one specific situation for some Chinese users, but do remember that system-ui is working perfectly matching the user OS's native interface.

fireattack commented 2 years ago

@NightFurySL2001

I'm aware the other aspects of this issue as you mentioned, and I'm pretty sure OP being an expert in CJK field, knows it better than both of us.

But let's go back the topic: I don't agree with you that MS YaHei is "not terrible"; it's too wide compared to majority of English typefaces. Also some punctuations are totally ruined:

GitHub default: image

system-ui (i.e. MSYH): image

Regardless, it being "enlarged" alone is already a serious drawback since the designers of the sites often have a fixed (perceptive) font size in their mind. Let's put it this way: if English users see the font in that size is expected, why Chinese users (when seeing the same English content) would need something different?


Using sans-serif does not come with this benefit as it uses the default font fallback regardless of system locale settings, which on Windows prioritise Japanese over Chinese and leading to more issues than of broken Latin text.

Totally false. Did you test it? Firefox and Chrome have slightly different fallback mechanics [1] in this regard, but both will fallback to Chinese version glyphs on a Chinese Windows. It even works with Chinese Windows with browsers in English display language.

(All tested on Chinese Win7)

Chrome: image Firefox: image

Chrome is even better when using sans-serif, because it uses Meiryo to display kanas and proper English fonts to display Latin letters. Firefox on the other hand, will use heuristics to guess the language of un-tagged content and use that for the whole page instead, it is not a glyph-by-glyph process.

Footnote [1] On chrome, make sure you set Chinese priority higher than Japanese. Which is the default if you use Chinese version Chrome. ![image](https://user-images.githubusercontent.com/4130991/192632440-4e878140-d5fc-4e63-911a-b4eadac7c486.png)

Ignore this point if your website has correct language tagging: /zh-hant/ja will fix the font for sans-serif most of the time. If your (or user-generated) content does not have any language information, system-ui is the better bet for localization.

Funny you mentioned lang tagging. This is one of THE worst issue of system-ui, actually, other than being ugly.

Even if you tag it with <lang="ja">, it will still use MS YaHei font if you use system-ui. See the screenshots above.


Also, system-ui is intrusive. If I don't like X font, I can always manually replace it with

@font-face {
    font-family: "XXXX";
    src: local("YYY");
}

However, this doesn't work with system-ui keyword (it used to work in Chrome, but they got rid of it); if certain websites use it, I have to replace the whole font stack manually.


At last, a more general point: https://infinnie.github.io/blog/2017/systemui.html is not the holy grail of system-ui issue. Refuting that alone doesn't mean all issues are non-issue. As I displayed above, the issue of it isn't limited to "niche, classic theme" users.

NightFurySL2001 commented 2 years ago

But let's go back the topic: I don't agree with you that MS YaHei is "not terrible"; it's too wide compared to majority of English typefaces.

Have you seen Tahoma for Windows 7 Classic theme (screenshot provided in previous comments)? It is wider and higher than Segoe UI, but users does not have a problem with it. What you are trying to do now is you are forcing people to follow your own aesthetic standards by saying the font is too wide compared to Segoe UI and ignoring all the other benefits of system-ui.

Also some punctuations are totally ruined:

This is non-issue: The font being used is compliant to GB 18030, which makes the quotation mark full-width as it is used in Chinese for quotation (E.g. “我觉得:‘你觉得’。”) This is a legacy problem related to the decisions of GB team and Unicode to share a codepoint for quotation marks. Font support (in Microsoft YaHei) from its vendor Microsoft is required to fix this "problem", and not a problem of system-ui.

Regardless, it being "enlarged" alone is already a serious drawback since the designers of the sites often have a fixed (perceptive) font size in their mind. Let's put it this way: if English users see the font in that size is expected, why Chinese users (when seeing the same English content) would need something different?

If you are designing for cross-platform, multilingual use, a "fixed (perceptive) font size" is a very bad decision. Some languages requires bigger line height/size to accommodate their respective languages, which sometimes reflects on to the fonts being used. It is better to use the designated font (and size) provided by the system for each language rather than trying to enforcing a constant aesthetic across all language groups.

If the system vendor does not think enlarging text is required (eg in Mac), then that will fit your usage. Else, just write your own font stack.

Totally false. Did you test it? Firefox and Chrome have slightly different fallback mechanics [1] in this regard, but both will fallback to Chinese version glyphs on a Chinese Windows.

Sorry, this is my fault. I did not test this issue thoroughly.

It even works with Chinese Windows with browsers in English display language.

Even if you tag it with , it will still use MS YaHei font if you use system-ui. See the screenshots above.

However, I failed to recreate this issue. system-ui with language tagging works just fine on pure English Windows. Screenshot below (latest stable Chrome & Firefox):

en-user en-user-firefox

This is an issue with Windows multilingual and should be raised to Microsoft. However, this alone shouldn't be an issue to block websites from using system-ui as the issue is vendor-specific. The testing works fine on Android and iPadOS, with respective correct locale display, and even better display of Latin text using Roboto (both using Simplified Chinese UI):

Screenshot of lang on Android and iPadOS ![image](https://user-images.githubusercontent.com/33471049/192778605-729618b4-8e0c-495f-a140-ad5085ba26ef.png) ![image](https://user-images.githubusercontent.com/33471049/192778769-c56673a4-2f0d-43b3-8ca4-5319c3302919.png)

Also, I will argue that displaying the correct localization with correct font when no language tag is present is more important than displaying the best visual result when no language tagging is done. You definitely do not want Meiryo to overrride the Chinese part (especially by default, Meiryo is overriding Microsoft YaHei in regedit) as most of the internet does not tag languages properly (e.g. GitHub user content). Using system-ui will ensure the correct locale is displayed based on system settings.

Also, system-ui is intrusive. If I don't like X font, I can always manually replace it with

system-ui is not designed to be replaced. It is just a keyword that is used to replace Mac's hacky -apple-system,BlinkMacSystemFont font stack while expanding the same functionality across platform, such that developers can integrate their website using the system font. For the screenshot provided in "the issue" by infinnie, remember, this is what the system font has already been using.

English

Aero theme

en-aero-font

Classic theme

en-classic-font

Simplified Chinese

Aero theme

zh-aero-font

Classic theme

zh-classic-font

There is no point to replace system-ui for something you want instead of what its intended purpose is. If you don't like it, write your own global CSS with !important keyword to always replace the site font.

At last, a more general point: https://infinnie.github.io/blog/2017/systemui.html is not the holy grail of system-ui issue. Refuting that alone doesn't mean all issues are non-issue. As I displayed above, the issue of it isn't limited to "niche, classic theme" users.

Please note, all issues I have been looking on system-ui ([StackOverflow](), and including your issue) points to this specific target group: Windows, Simplified Chinese users; literally no other languages have any related kind of issues.

TL;DR: system-ui is for using the current system font. Locale tagging might be broken for some languages, however all texts will be displayed by the user's preferred locale first instead of relying on prewritten font stack. Some fonts for specific locale (most notably Simplified Chinese) will be bad in some particular instances; in other languages it will be enough for normal daily usage.

Side note: Windows has always been bad on multilingual display; Win32 doesn't even handle multilingual text in the same line. That is the main point why this "issue" is being brought up in the first place from Simplified Chinese users (bad Latin in SimSun from Windows 95-XP, "wide" Latin in Microsoft YaHei from Windows Vista-11). However, there is no way that this should be the point that all sites must stop using system-ui, and CSS should drop support for system-ui. It is a great tool for devs to use, and if you can't handle it, do write your own font stack; just please dont shove your opinion through all other user's throat. The most minimal fix that does not affect other users should be contacting Microsoft and let them fix it (e.g. WinUI), rather than blocking all other global users from using system-ui.

myakura commented 2 years ago

Please note, all issues I have been looking on system-ui (StackOverflow, and including your issue) points to this specific target group: Windows, Simplified Chinese users; literally no other languages have any related kind of issues.

Well, system-ui isn't great on Japanese Windows either. Yu Gothic UI, the font which is resolved when system-ui is used on Windows (10+), looks like a condensed typeface thus is not great when used in paragraphs. People complained when GitHub added system-ui to their theme so they tweaked their CSS to add Meiryo for readability https://github.com/primer/css/pull/1573 .

I really wish people use sans-serif (or serif) instead of system-ui for content; system-ui takes away users' ability to customize fonts in browser settings...

NightFurySL2001 commented 2 years ago

That is still a problem with Microsoft and bad font choices, along with bad Win32 font technology. Please report the problem to Microsoft. (Same for customization: report the bug to system vendors; not a problem from CSS specs)

If system-ui is so bad, what alternatives do you suggest for replacing the lengthy -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji" (and even longer if considering Android, also bad display of Arial on *nix systems) to achive the same goal: "integrate with the look and feel of the native OS", while being "friendly" to localization? If this goal not suitable to be achived, what goal should system-ui do?

fireattack commented 2 years ago

You keep saying real issues are "non-issue" because "that's what MS should fix", "that's what XXX should fix", that's a frustrating way to constructively discuss anything.

This is non-issue .... This is a legacy problem Font support (in Microsoft YaHei) from its vendor Microsoft is required to fix this "problem", and not a problem of system-ui.

The full-width curly quotes isn't an issue of MS YaHei, which is supposed to be a Chinese font. It's totally fine for it to have full-width quotes. The issue is you force to use MSYH on pure English content, which is what system-ui on Chinese Windows does.

If you are designing for ... multilingual use, Some languages requires bigger line height/size to accommodate their respective languages, which sometimes reflects on to the fonts being used.

Exactly?

How is this an advantage of system-ui than disadvantage?

However, I failed to recreate this issue. system-ui with language tagging works just fine on pure English Windows.

???? The whole discussion is about issues of system-ui for Chinese Windows (or Japanese Windows) and now you test on English Windows?

Of course it doesn't happen with English Windows, because its "system-ui" is Segoe UI, which don't have CJK glyphs and will fallback to a different Chinese/Japanese fonts for that. The whole point of "system-ui bad" is because on Chinese Windows the default font (MSYH) has too large character set and will be used to display anything, even when improper.

this alone shouldn't be an issue to block websites from using system-ui as the issue is vendor-specific

Previously you said these are non-issues and shouldn't block because it only affect a small, niche, classic theme users (quote: "Do be noted that this 'issue' only arises when the user voluntarily choose to use the Classic theme"), and I pointed it out it actually affects all the Chinese/Japanese Windows users. Now you moved the goalpost to say "Chinese, Windows users are too small to block".

Also, I will argue that displaying the correct localization with correct font when no language tag is present is more important than displaying the best visual result when no language tagging is done. You definitely do not want Meiryo to overrride the Chinese part by default, Meiryo is overriding Microsoft YaHei in regedit

I already said, will example, this won't happen if you have correct language priority setting. Chrome will pick characters based on that. Even on English Windows. Your own screenshot confirms it. Not sure how it has anything to do with regedit, or system-ui. Go ahead and change your language priority in Chrome. You will see changes immediately in real-time:

image Result (remember to refresh): image

image Result (remember to refresh): image

This problem actually WILL happen when you use system-ui. You "definitely do not want MSYH to override the Japanese kana part", and it will happen if you use Chinese Windows + system-ui.

Using system-ui will ensure the correct locale is displayed based on system settings

Again, totally false. At this point, I feel like you don't know, or have not thoroughly tested, how system-ui or font fallback works. Since you use Chrome, here is how it works in Chrome:

The problem with system-ui on Chinese Windows is, MSYH have all the glyphs. Once it is set, it will override virtually everything, language tagged or not. As said above, this won't happen if you are using English Windows, because its system-ui font doesn't have CJK characters.

The issue that "on English Windows, untagged content will use Meiryo to display Chinese characters instead of MSYH" you mentioned is because language priority setting isn't properly set (or set at all). So Chrome have nothing to work with, and it picks Japanese over Chinese. (This is not even "wrong" by the way: it will either mess Chinese characters in Chinese, or Japanese kanjis in Japanese.) If you prefer Chinese characters, this can be easily fixed by making sure Chinese locale has higher priority than Japanese, as said above.

You don't need system-ui to 'fix' this, because on English Windows all it does is just to apply Segoe UI on all the content and then it relies on font fallback to do the reset of the job. The same can be achieved by using any English font - even sans-serif (which isn't a real font, but it maps to Arial by default on English Windows). Or just use Segoe UI.

TL;DR: system-ui isn't what fixed your "Chinese characters in Meiryo" issue. And it causes all sorts of other issues on Chinese and Japanese Windows simultaneously.

There is no point to replace system-ui for something you want

I.. what?

all sites must stop using system-ui, CSS should drop support for system-ui

No one is suggesting any of these.

shove your opinion through all other user's throat

No one is doing that, either. All the websites listed above are too big to not deal with system-ui's drawbacks, because they have sizable Chinese users. Which is exactly why they "do write your own font stack" as you suggested.

Keep in mind we're not asking for special treatment beyond everyone else. All these font stacks are complex because they're trying to work around the issues WITHOUT sacrificing experience of other users, be it English, MacOS, Linux, Android, or whatever. It's not perfect, but they are trying to be as inclusive and comprehensive as possible. You're the one that suggesting dev to just ignore real issues with millions if not billions of Chinese, Japanese Windows users, OTOH.

If system-ui is so bad, what alternatives do you suggest for replacing

Just use sans-serif? Or even just stick with these long mess font stacks. Yes it sucks system-ui didn't magically work in all cases but that's the reality you can't simply dismiss.

NightFurySL2001 commented 2 years ago

@fireattack

Chinese users will see different (wrong) size of English content when using system-ui.

I still does not understand why you say the Latin part of Microsoft YaHei is bad. It is just based on Segoe UI and slightly enlarged to match with Chinese characters (due to visual differences), and there is nothing inherently bad with Microsoft YaHei. Font size is a complex matter and you don't even get the same size on the same platform: did you checked Tahoma from Windows XP/7 Classic theme? SF Pro on Mac have slightly higher x-height compared to Segoe UI, and on the same screen SF Pro appears larger than Segoe UI too just like Microsoft YaHei, so does this makes SF Pro also a bad font?

Designating a font as "bad" isn't only just what you think looks good. As far as I know, so far on the internet across English and Chinese communities, no one is saying the Latin part of Microsoft YaHei is bad. There is simply just no "correct" size for text; what is given by system-ui is what your OS has already been using on its interface.

???? The whole discussion is about issues of system-ui for Chinese Windows (or Japanese Windows) and now you test on English Windows?

Sorry as I am confused. I do not have much time to test across multiple languages and settings.

I will acknowledge that sans-serif is dependent on the browser, while system-ui depends on the system.

system-ui works by simply applying MSYH (Simp. Chinese), Yu Gothic UI or Meiryo (Japanese), or Segoe UI (English) to all the content, regardless if there is a language tag or not (it also ignores display language setting of Chrome).

Yes, that is correct. However, the language tagging issue is a problem on Windows Win32 API, it has nothing to do with how CSS specs define system-ui. Mac and Android will present the correct locale using language tag (Screenshot above).

There is no point to replace system-ui for something you want I.. what?

You mentioned replacing system-ui as "intrusive" and tried to replace it using @font-face. It is just like saying you want to replace serif (or cursive) using @font-face.

all sites must stop using system-ui, CSS should drop support for system-ui No one is suggesting any of these.

You (and infinnie) are suggesting all the major sites to stop using system-ui on various issues on GitHub. This is the CSS drafting repository; suggesting users should stop using system-ui is essentially just trying to deprecate the use of system-ui in CSS.

shove your opinion through all other user's throat No one is doing that, either.All the websites listed above are too big to not deal with system-ui's drawbacks, because they have sizable Chinese users. Which is exactly why they "do write your own font stack" as you suggested.

As mentioned above, there is nothing inherently bad with Microsoft YaHei, just you saying that the Latin (and kana) parts are "bad". As a native Chinese/English user, I do not see any problems using the Latin part from Microsoft YaHei (apart from apostrophe/quotation marks; easy to fix with CSS unicode-range). I did not learned Japanese, so the kana part is still up for debate; but do remember this "issue" you're saying is an aesthetics issue, which will vary from person to person, and it's you that's saying Microsoft YaHei looks bad.

Also, I just noticed that Japanese on Windows 10 have been changed from Meiryo to Yu Gothic UI. Meiryo's Latin part is based on Tahoma but stretched wider, while Yu Gothic UI's Latin part is based on Segoe UI with no stretching applied. Does it make sense when Japanese users say that Meiryo looks better than Yu Gothic UI, when you are saying that Microsoft YaHei looks worse than Segoe UI?

image

As mentioned above, it is about personal aesthetics at this point rather than the font being inherently bad (e.g. SimSun bitmap text at 12pt) and everyone will have their opinions on the issue. It is in no way that one person should just let everyone stop using system-ui because their system font looks bad. There is also no way that Windows can make a font that makes every user happy.

Yes it sucks system-ui didn't magically work in all cases but that's the reality you can't simply dismiss.

From a technical view, system-ui is in perfect working order according to the CSS spec: use the system font. You don't like what you look at? Change your system font; it'll change system-ui. /s

But for real, this issue is not the burden for the W3C CSS working group. Stopping the use of system-ui just because the font choice on Windows looks bad for some languages isn't logical. If Windows never change the font again (or make more bad choices), should all developers stop using system-ui?

What do you suggest the W3C CSS working group to do with system-ui looks bad/undesirable for some users? A definition change? Or to deprecate system-ui?

fireattack commented 2 years ago

@NightFurySL2001 MSYH's Latin characters are not "bad" on letter level. It just doesn't suit for displaying English-only or English-majority content due to dramatic size difference and punctuation issues. Same goes to Meiryo, just worse.

SF Pro on Mac have slightly higher x-height compared to Segoe UI, and on the same screen SF Pro appears larger than Segoe UI too just like Microsoft YaHei

Some quantitative comparisons might help. How "larger" is it? Just as large as MSYH?

Does it make sense when Japanese users say that Meiryo looks better than Yu Gothic UI, when you are saying that Microsoft YaHei looks worse than Segoe UI?

Sorry, I genuinely don't get what you mean. I think Segoe UI is better than MSYH, yes. I also think (based on your image, I'm not familiar with Yu Gothic UI) Yu Gothic UI ('s latin part) is better than Meiryo's, so if Japanese users tell me that, I will agree with them. Because both former ones are more compact. Is it supposed to be some contradictions here?

I do not see any problems using the Latin part from Microsoft YaHei

So lets make it clear before we continue to argue semantics: do you genuinely think this: image is better than this: image ?

What do you suggest the W3C CSS working group to do with system-ui

Nothing. I didn't open this issue, or even replied here before your comment. I do agree with https://github.com/w3c/csswg-drafts/issues/3658#issuecomment-512514812.

My comments elsewhere, are meant to warn people who care about user experience than some purist ideology, to think twice before using system-ui due to its issues.

And while I am flattered you thought that way, I'm not the only one who expressed the opinion on this matter to "block" changes. I didn't even involve in the discussions that eventually caused GitHub/Wikipedia/Bootstrap to roll back their changes. I did make comments "in time" on SO's case IIRC, but I'm far from the only one (and lots of English users seem to have issues with system-ui on other platforms too, but I am not familiar with that enough to comment).

NightFurySL2001 commented 2 years ago

Some quantitative comparisons might help. How "larger" is it? Just as large as MSYH?

SF Pro (Text) is not as large as Microsoft YaHei, but comparable to Tahoma. For numerical sense, the x-height are: Segoe UI 1024, SF Pro 1078, Tahoma 1117, Microsoft YaHei 1106. Caps height are: Segoe UI 1434, SF Pro 1443, Tahoma 1489, Microsoft YaHei 1549. Ascender heights are: Segoe UI 1516, SF Pro 1506, Tahoma 1556, Microsoft YaHei 1637.

Compared to Segoe UI, Microsoft YaHei is geometrically scaled up 108%, ratio between x-height and ascender is same as Segoe UI (67.5%). SF Pro x-height is 5% larger than Segoe UI while other metrics are relatively same as Segoe UI; ratio of x-height to ascender is 71.5%. Tahoma x-height is 9% larger than Segoe UI, and slightly bigger than Segoe UI in general by ~1%; ratio of x-height to ascneder is 71.8%. (Ratio of x-height to ascender usually determines the visual size of a font, i.e. the ratio of height of x compared to ratio of height of l)

It just doesn't suit for displaying English-only or English-majority content due to dramatic size difference and punctuation issues.

The scaling on Microsoft YaHei is actually done to make it harmonize to Chinese parts; there are some generic metrics used in Chinese (and Japanese) fonts and those metrics usually requires the Latin part to be scaled up to make it visually harmonize. Reference: Noto Sans CJK/Source Han's Latin part is scaled 113-115%, Adobe Clean at 105-116%, IBM Plex JP at 105%. As I said, there is nothing wrong inherently by scaling the Latin part up in CJK fonts.

I also think (based on your image, I'm not familiar with Yu Gothic UI) Yu Gothic UI ('s latin part) is better than Meiryo's, so if Japanese users tell me that, I will agree with them. Because both former ones are more compact.

Please read my comment (which you quoted) carefully: Japanese users prefer Meiryo over Yu Gothic UI. See @ myakura comment here or this twitter thread, quoted below:

system-uiは文字通りUIのフォントを指定するためのもので、本文にはまったく向いていません。 Google translate: Before I knew it, system-ui was added to GitHub's font-family specification, but on Windows it's displayed as Yu Gothic UI and it's hard to read, so I really want you to stop it.

So lets make it clear before we continue to argue semantics: do you genuinely think this: [...] is better than this: [...]?

Yes. The design of Segoe UI is actually towards the smaller size (smaller x-height:ascender ratio), in this case Microsoft YaHei (UI)'s scaling up is more suitable and have better legibility. Here are a few screenshot using other fonts:

Segoe UI image

SF Pro Text image

Tahoma image

Microsoft YaHei (UI) image

Meiryo (UI) image

Yu Gothic (UI) image

However, I do have to mention that I usually use my own CSS rule to override the webpage fonts, and I'm using Sarasa Gothic which also has a larger size compared to Segoe UI and might affect my own aesthetic jusdgement.

fireattack commented 2 years ago

I'm sorry, but why did you constantly compare to Tahoma? Isn't it only used by "classic theme" users, an actual niche group you think we should just ignore all together (I'd say less than 1% share if not 0.1%, but I pull the number out of my ass)?

Anyway, I take what you said as "SF Pro is slightly larger than Segoe UI, and MSYH is much larger". Sounds like it proves my point.

The scaling on Microsoft YaHei is actually done to make it harmonize to Chinese parts

I know. We're talking about it ruins english-only content.

Japanese users prefer Meiryo over Yu Gothic UI. https://github.com/w3c/csswg-drafts/issues/3658#issuecomment-1260957890 or this twitter thread, quoted below:

That's because Yu Gothic UI's JAPANESE part is worse, not Latin part... The Japanese (kana and kanji) characters are super narrow and aren't suitable for normal text. It's literally not the purpose of it (it's narrower to save space; Yu Gothic is the variant meant for the normal text).

And removing system-ui will not change the latin part to Meiryo because they will be applied a proper English font...

towards the smaller size

The font on GitHub IS small. 14px.

Here are a few screenshot

Can you please at least screenshot in 100% zoom? All the fonts in your images are blurry (and it's not because of DPI setting because fonts are vector-based). And you conveniently didn't screenshot MSYH in the same setting to show how ridiculously large it is.

I usually use my own CSS rule

Dude, wtf? You are wasting time arguing something that doesn't even affect you, with people who actually have to suffer this. And if I understand it right, you don't even use Chinese Windows to begin with. All you did is to run a VM or second machine to test it on a whim. I'm confused about this whole thing and what you're trying to achieve.

If you think nothing should be done on w3c's end, i agree with you. Never fought for that because I acknowledge it's Windows' issue. If you think sites should just start using system-ui for "just because" reasons, sorry I'm going to continue expressing my opposition when giving chance every time for the reasons listed clearly above. At this point you haven't give a single "pros" of using it, only "not so bad".

NightFurySL2001 commented 2 years ago

Sorry for unclear screenshot. I will use another software and replaced the above screenshots with additional screenshots for Japanese fonts.

The font on GitHub IS small. 14px.

That is the point. Given the same font size, larger visual font will provide better legibility. That is merely a fact.

You are wasting time arguing something that didn't even affect you with people who actually have to suffer this. And if I understand it right, you don't even use Chinese Windows to begin with

That is because sans-serif produce undesirable effect for me. sans-serif fallbacks to SimSun on my primary machine on Chrome for Chinese text for unknown reasons, and it definitely looks worse. Using system-ui does fix it for me but I could not reproduce the issue on other machine, so I just opt for overriding CSS with Latin parts from Sarasa Gothic and system-ui for the rest. Also, what you're saying still is still a problem with aesthetics that "Microsoft YaHei looks bad", which will differ from person to person. I could not comment on Yu Gothic UI's case.

My point is, system-ui is in working order, and W3C shoud not do anything. If devs want to use system-ui to match the user's interface, I don't see any reason to block it.

Just for reference, could you provide any links that anyone else is saying Microsoft YaHei's Latin part looks bad from either English or Chinese communities?

fireattack commented 2 years ago

fallbacks to SimSun on my primary machine on Chrome for Chinese text for unknown reasons

Install https://chrome.google.com/webstore/detail/advanced-font-settings/caclkomlalccbpcdllchkeecicepbmbm?hl=en (this is an official extension; it basically just provides a way to adjust corresponding font settings in Preferences. You can edit them manually too it's just a JSON file):

image

MSYH has been the default sans-serif font for Simp. Han's for years, but it was SimSun at one point. If I have to guess, your issue probably is caused by an old profile which inherited such settings from previous installs. Wish it helps.

Just for reference, could you provide any links that anyone else

As I clarified above, I meant that they're too big (wide?). Not the glyphs themselves are bad.

chris-morgan commented 2 years ago

I say there are two problems here:

So my actual proposal here is:

  1. Update non-normative text in the spec to discourage the use of system-ui for online content, with explanation;
  2. Work with browser makers to improve the fonts sans-serif resolves to (so that web developers don’t feel the need to go beyond it);
  3. When all this is done, evangelise collapsing the teetering piles of system font stacks down to sans-serif. Just sans-serif and nothing else.

One small part of this is in scope for CSSWG, the rest is largely up to browser makers.

Sora2455 commented 2 years ago

Anecdotally, I've always seen system-ui advertised as "use this keyword so that the user sees the same font as their OS", so I disagree with your first dot point. From my point of view, the problem is your second dot point: that for some versions of windows in some languages (particuarly when the language of the webpage does not match th language of the OS) the font chosen is sub-optimal.

Also judging by this comment, system-ui is not only a different font per language on Mac OS, but sometimes a different font for different font sizes.

chris-morgan commented 2 years ago

OK, macOS is apparently doing a much, much better job of this than I realised. I downgrade “in practice always” to “commonly” (because I think it’s still what every other platform does) with the other obvious corresponding wording changes.

As for the first part: it often starts as “the same font as their OS”, but this is very consistently “… because sans-serif is ugly”. (Then after that it generally becomes cargo-culting.) I don’t believe that “the same font as their OS” is actually what people are generally aiming for, and when they are it’s fairly consistently misguided: and the problems apparent in the second point show that it’s not what they should be aiming for, quite apart from the whole obvious thing of the semantic mismatch. If sans-serif was improved, people wouldn’t feel the need for something better, and so wouldn’t abuse system-ui.

mirabilos commented 1 year ago

TIL about system-ui and I’m appalled that such a thing even exists. Now researching how to even set that (given I’m under GNU/Linux with no desktop environment, that’s probably going to be hard)…

Please remove this from the spec. See also.

tats-u commented 1 month ago

system-ui really sucks in Windows + Japanese locale + Chromium-based browsers. Yu Gothic UI is a really-bad-quality system UI font.

https://issues.chromium.org/issues/331123676?pli=1

e1a0b7396220-20240325 d589ebd147f6-20240325 Images from: https://zenn.dev/inaniwaudon/scraps/f224417d4c51ee (Japanese)

GZwtagyaAAAEbFh Image from: https://twitter.com/shirouzu/status/1845400436678983704 (Japanese)

20241012165848 Image from: https://tawara-memo.hatenablog.com/entry/2024/10/12/174432 (Japanese)