-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-fonts-4] system-ui
generic font keyword and lang attribute
#9518
Comments
These tests are added in this CL: |
Probably worth checking with some Apple folk about this, as (by my understanding) Safari has been the primary driver of the "ui"-related generics. Local testing confirms that it definitely uses the content language to resolve
renders with a very different font from:
Which is what I'd expect: (Currently Firefox renders these two examples identically, but I consider that to be a bug.) Not sure if @litherum is still around to comment? Maybe @hober / @nt1m / @fantasai can shed further light? |
I tend to agree with you on that. If we all agree on that, I would prefer to see that clarified in the spec, as I interpret the current wording to either not specify that or even lean in the direction of a default font that the system, not the content lang determines. |
There's a passing remark in the spec (in Example 6) about:
which I think relates to the idea that there may not be a single "UI font" that covers everything, so "the UI font" may in fact be multiple fonts, with language support being the obvious basis on which they'd be organized. But then the question arises as to how to choose which font from the "collection of system user interface fonts" to use for any given piece of content, if there's any overlap whatsover in their coverage. And that, I guess, is where the content But that's all somewhat vague, and could certainly use clarification. |
I'm hearing rough consensus that the spec should clarify the use of the content language, perhaps with an Urdu example as well. |
"The default user interface font on the platform on which the UA is running" is not in the content-language, but in the platform language, no? Aside that, I wonder if it's implementable on other platforms without having a full list of fonts for all languages on the platform. Anyone knows? |
But in practice "the default user interface font" is not a single font; as the note in Example 6 suggests, it is really a collection of fonts -- otherwise not all languages would be able to be displayed in the UI. If my platform language is (say) Hindi, and the default UI font being used for the Hindi interface is Nirmala UI, but then the UI needs to display some text in Russian or Hebrew or Chinese, the platform is going to have to use a different font for that part of the UI. So what "the UI font" actually resolves to will depend on the content it's being asked to display. Primarily, the supported character repertoire of the various font resources will determine which UI font can be used for a given piece of text, but in some cases (e.g. Chinese vs Japanese, or Arabic vs Urdu) language may also be important. And that should clearly (IMO) be the language of the content concerned, if known. |
Right, most modern OS have the mechanism to link or fallback multiple physical fonts. We agree on this point, right? As you know, the "font set" (or "font fallback list" or "font link set") usually vary by the platform UI langauge. IIRC, macOS stores a list of fonts in a plist, that can have if-branch by the language, if my knowledge isn't outdated. For this issue, I think the question is whether the "font set" emulation in the browser should be the "font set" of the platform language, or of the content language. I think the original motivation was to expose the "font set" mechanism, in order for web apps to have the same look-and-feel with other native apps. From that perspective, I assumed that it's platform language, because all other apps are in the platform language. If we want to change that, or if it was my misunderstanding, I'm fine, but as far as I know, it's technically not possible on Windows at least. I'm not very familiar with Linux. If we were changing this, I wish us to make sure it's implementable on all platforms. |
Just to make sure we're on the same page, we're talking about |
(Disclaimer: I don't work on web tech any more; I'm just commenting to provide background info.) I think we're discussing a few different things here:
|
@jfkthame wrote:
There is more text (and crucially, not just in an example) (my emphasis):
and also
So it seems well established that generics can map to multiple local fonts and that content language can be used to choose among them. It is just a case of clarifying in |
… by unicode coverage and content language, #9518
Spun off from:
web-platform-tests/interop#499
This WPT query:
https://wpt.fyi/results/css/css-fonts?label=experimental&label=master&aligned&q=system
has tests
system-ui-ja-vs-zh.html
system-ui-ja.html
system-ui-ur-vs-ar.html
system-ui-zh.html
which are testing whether there's a difference for the system-ui font under differing lang attribute values.
We don't see where that behavior is taken from in terms of spec text.
The spec text itself is: https://www.w3.org/TR/css-fonts-4/#system-ui-def
Specifically
reads to us more like it would belong to the locale / language setting of the OS, not specifically the content lang attribute.
CC @kojiishi
The text was updated successfully, but these errors were encountered: