WICG / local-font-access

Web API for enumerating fonts on the local system
https://wicg.github.io/local-font-access
Apache License 2.0
75 stars 16 forks source link

Double-check you're using the right language #79

Open jyasskin opened 2 years ago

jyasskin commented 2 years ago

As mentioned in https://github.com/whatwg/html/issues/7757, many other specs that need a default language use the document's language rather than the user's language. Since the font name is expected to be presented inside the document, it might work better if this spec switches to the document's language.

However, it's not obvious what to do inside of a Worker if we want to default to the document's language.

inexorabletash commented 2 years ago

Thanks for filing this. This is additionally challenging in that apparently many OS APIs for enumeration don't provide all the strings and let the caller decide which localization to use; instead they only return data for the "current locale".

I haven't checked whether this means current browsers are not conforming per https://www.w3.org/TR/css-fonts-4/#local-font-fallback or not - User agents that also match other full font names, e.g. matching the Dutch name when the current system locale is set to Dutch, are considered non-conformant. - I suspect (but don't know!) that all browsers are non-conformant, and therefore the spec text is aspirational.

Given that, I don't know whether it's best to (1) describe the unpleasant reality here, (2) describe the aspirational state, and declare reality non-conforming, or (3) leave it ambiguous and hope no-one notices...

jyasskin commented 2 years ago

Maybe describe the aspiration as a SHOULD, and also say implementations MAY obey reality?

I didn't see a test for the css-fonts-4 line in wpt.fyi, but I might have missed the right search term. It's probably worth filing a bug with them to at least test their aspirational claim ... although that might require some difficult changes to the web-platform-tests machine setup. https://github.com/w3c/csswg-drafts/issues/3177 is related, but seems to be about clarifying the aspiration rather than writing a test for it.