Skip to content
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] system-ui-serif, system-ui-monospace, and system-ui-rounded #4107

Closed
litherum opened this issue Jul 12, 2019 · 64 comments
Closed

Comments

@litherum
Copy link
Contributor

litherum commented Jul 12, 2019

Hi!

This year, Apple has released 3 fonts in macOS and iOS. Here are what they look like:

New York:
Screen Shot 2019-07-11 at 10 38 00 PM

SF Mono
Screen Shot 2019-07-11 at 10 38 18 PM

SF Rounded
Screen Shot 2019-07-11 at 10 38 30 PM

We've gotten requests to use these three fonts on the Web. However, we don't want to treat these fonts just like any other font. On macOS and iOS, these fonts are only available by running special AppKit/UIKit functions, and don't appear in font enumerations. This choice is intentional, as these fonts are not intended to be document fonts for regular content. Instead, they represent the identity of the platforms themselves.

Because of the requests, we'd like to propose adding these fonts to the CSS Fonts spec as siblings to system-ui, and including some explanatory text in the spec about the difference between these fonts and any other installed fonts on the system.

Android has Droid Serif and Droid Sans Mono which would map to system-ui-serif and system-ui-monospaced. I don't know if Windows has any analogues with Segoe UI.

We've recently implemented support for these in Safari behind an SPI flag, off by default. This is an SPI, not an experimental feature, so Safari users can't even enable the fonts if they wanted to just yet.

@AmeliaBR
Copy link
Contributor

AmeliaBR commented Jul 12, 2019

What would be the authoring use case for this? When would you use system-ui-serif instead of serif?

The whole purpose of the generic font keywords is that the results are suited to the system & the user choices. If a new version of Safari wants to update which fonts the generic keywords map to by default, go right ahead. But I don't see a reason to keep serif and monospace as user-customizable fonts, but then offer authors a way to ignore the user preferences & get the system defaults instead.

The fact that these fonts don't have an exposed family name is an implementation detail on MacOS/iOS. If there are technical reasons for that, but you still want them available to web content, I think it's appropriate to continue to use prefixed keywords for them.

(I personally don't understand branding logic behind the "don't let people use them in documents, but do let websites use them" argument, but 🤷‍♀ …lawyers. )

I don't know if Windows has any analogues with Segoe UI.

Segoe is a super-family on Windows 10, but it doesn't have monospaced or serif version: it has handwriting versions. Segoe Print is the modern alternative to Comic Sans.

While we're on the topic: Segoe UI looks absolutely horrible when rendered without ClearType hinting (at least, I think that's why it sometimes looks awful). I really hate that we're encouraging developers to use system-ui in order to get San Francisco on Apple devices, instead of thinking carefully about their font stack in a cross-browser way.

@Crissov
Copy link
Contributor

Crissov commented Jul 13, 2019

How are New York, SF Mono and SF Rounded used in Appleʼs UIs? Are they the only fonts used in the UIs? Are they the only ones hidden for corporate identity purposes? Are the latter two fonts proper parts of the SF / San Francisco (super) family?

CSS generic font keywords were never well designed (especially i18n-wise), but (at least without further information) I donʼt think this proposal improves anything about that.

@litherum
Copy link
Contributor Author

When would you use system-ui-serif instead of serif?

When you wanted New York instead of Times. Times has been baked into the Web Platform for so long, we effectively can’t change the serif - Times mapping.

We also don’t want to automatically opt a bunch of websites into using New York because it is intended to be used selectively in new content. It isn’t a document font that is supposed to be used everywhere.

@AmeliaBR
Copy link
Contributor

Times has been baked into the Web Platform for so long, we effectively can’t change the serif - Times mapping.

There is nothing baked-in about using Times and Arial for serif and sans-serif. Other browsers let the end user change the mappings. I use Georgia and Tahoma. For monospace, even the default mapping varies by browser/OS.

Any website that is using the generic font family keywords is accepting that the appearance will vary by browser & OS & user preferences. If an author really wanted Times, it's easy for them to say so.

That said, if Apple for branding purposes doesn't want the new fonts to ever be the default font used in web content, that's fine. As I said before, this is one case where I think it's fine to keep using CSS prefixes, since this (fonts that you can't access by a normal name) is a feature that has no equivalent in other OS.

@othermaciej
Copy link
Member

othermaciej commented Jul 13, 2019

@AmeliaBR I think your objection has three core elements. I'll try to restate it, and please let me know if I got anything wrong. I'll use the system-ui-serif example, but this could apply to all of these:

  1. Objection: Introducing system-ui-serif to mean the system serif font (where that is defined and is not Times) is unnecessary, because the browser could just change the meaning of serif to be, say "New York" on Apple platforms.

  2. Objection: system-ui-serif is redundant with serif, because they don't have meaningfully distinct use cases for authors.

  3. Objection: Introducing new symbolic font names is sad, because the old names like serif allow customization in many browsers, but system-ui and its possible future friends do not.

Let me know if I missed a key part of your objections.

Now, addressing these in turn:

  1. Response: In practice, browsers can't change the default meaning of serif. Nearly all browsers map it to Times by default, and some web content has come to depend on this. The default Times mapping is necessary for web compatibility, at the very least for desktop web content. It's true that the user could customize it, and some website may subvert author intent or outright break if the user does that.

  2. Response: system-ui-serif has a distinct use case from serif for authors. It means: give me a serif font that matches the system UI appearance, because I'd like this web content to blend in with the system look. On the other hand, serif, depending on author expertise, means one of "give me a serif font, I don't care which" or "give me Times, that's what I see on my system so that's what users will get". Neither of these is the same as "match the system standard serif font". In reality, the alternative to system-ui-serif for its intended use case is a long fallback list of the known system serif fonts, carefully ordered to avoid the wrong one appearing on the wrong system.

  3. Response: Customizability can be valuable. On some systems, the system fonts are customizable. It would make sense for the system-ui family of symbolic font names to follow system customization, rather than browser-only customization. But, in any case, authors already have access to requesting specific fonts by name, in such cases, the font is not customizable at all. In the absence of system-ui-serif and the like, websites would have to specify fallback lists of exact fonts to get the same effect. And that isn't customizable even in theory, or at the system level.

I'll add that none of this depends on the fact that the fonts aren't normally accessible by name. That makes the use case more urgent for some, but the use case is not really satisfied by specifying exact font names.

@AmeliaBR
Copy link
Contributor

Thank you for the detailed response, @othermaciej. Yes, you summarized my concerns fairly. But I remain unconvinced.

I still don't see an authoring use case for "match the system standard serif font" because most systems don't have standard serif (or rounded or monospace) fonts. @litherum's proposal states that there is an authoring demand to access these particular new fonts on Apple devices. But that's different from the argument for system-ui, which was that many major websites were crafting font stacks designed to match the standard system font for each OS.

I'd also be curious to see any evidence of web incompatibility for changing the Times/Arial defaults — just because something would change doesn't mean it would be incompatible. And if changing the generics is incompatible for a given website, then that website is probably already broken for many users. If there is a web compability reason to map the generic font names to specific fonts, we should put that in the spec.

@litherum
Copy link
Contributor Author

litherum commented Jul 14, 2019

Evidence of WebGPU incompatibility

In the WebKit source, we spoof the metrics of Times to match Windows’s metrics. We did this for web compat. Asking for Times by name is relatively rare compared to asking for serif and expecting Times.

Another piece of this issue that I forgot to include in the original post is the fact that the macOS and iOS APIs that access these fonts do it by token, not by name. Nowhere in source code do you ever say “New York” to get New York in a native app. Instead, you ask for “the serif design of the system font.” The mapping of system-ui-serif -> New York may change in the future. So, asking for New York by name isn’t expected to be stable over time.

@othermaciej
Copy link
Member

othermaciej commented Jul 14, 2019

I still don't see an authoring use case for "match the system standard serif font" because most systems don't have standard serif (or rounded or monospace) fonts.

Rounded appears unique to Apple platforms. But system serif and monospace system fonts seem to exist on at least Android, iOS/iPadOS and macOS. According to statcounter, these operating systems account for 59.56% of global browsing use share. That seems like a significant enough share that it would be valuable

So far, we've not exposed these fonts to the web at all, and we'd be very reluctant to expose them to the open web as symbolic names with a -apple or -webkit prefix. That would leave other platforms out in the cold (either with existing serif/mono system fonts, or if they add them in the future) and would lead to authoring of Apple-platform-specific CSS, which we would prefer not to encourage further. Right now they are only exposed in specific native apps that opt in. We'd prefer websites and web apps to have access to this functionality as well, if a suitable syntax is accepted as standards-track

@Crissov
Copy link
Contributor

Crissov commented Jul 14, 2019

How are existing font keywords caption, icon, menu, message-box, small-caption, status-bar not suitable to access these fonts?

System fonts can only be set as a whole; that is, the font family, size, weight, style, etc. are all set at the same time. These values can then be altered individually if desired.

@kojiishi
Copy link
Contributor

I support the proposal.

IIUC @AmeliaBR's points apply not only to this proposal but also to the original system-ui. At that point, we understood two different web author's voices:

  1. Wanting to use user's favorite generic families.
  2. Wanting to use the same fonts as other native applications.

We resolved generic families to serve for 1, while system-ui to serve for 2. When certain number of web authors wanted to create app-looking pages, adding system-ui had a clear benefits over hard-coding system font names of all major operating systems in their CSS.

Because the motivation for system-ui is to give the same capability as applications to the web, when applications got new capabilities, I think it's natural and necessary to allow the web to use them.

@emilio
Copy link
Collaborator

emilio commented Jul 14, 2019

Aren't system font's the mechanism for (2)? What's the status of that in other browsers?

In Gecko, you can do font: message-box or font: caption for example to get a font that looks like your system's. It seems like Blink and WebKit also support these.

Not particularly opposed to the proposal, but want to understand how it compares to them. These look more like system fonts than font family names per se. But I guess since they don't convey the size and such that a system font would have it's ok to make them just generic family names?

@litherum
Copy link
Contributor Author

litherum commented Jul 14, 2019

font: message-box or font: caption for example

Yep, these get you San Francisco in WebKit on macOS and iOS. None of the existing font or font-family keywords get you New York, SF Mono, or SF Rounded. And, because these fonts aren't exposed to the system as regular fonts available in pickers, there is currently nothing you can type in CSS that will give you access to them. system-ui-serif, system-ui-monospaced, and system-ui-rounded would be the only way to access these fonts.

@othermaciej
Copy link
Member

How are existing font keywords caption, icon, menu, message-box, small-caption, status-bar not suitable to access these fonts?

System fonts can only be set as a whole; that is, the font family, size, weight, style, etc. are all set at the same time. These values can then be altered individually if desired.

Two reasons:

  1. None of those necessarily correspond to "the system serif font" or "the system monospace font". On operating systems I am familiar with, none of those are set in serif or monospace.

  2. The system serif and monospace fonts (just like the regular system font) do not necessarily have an implied size, weight or style; they are used in different sizes, weights or styles in different contexts.

This particular set of keywords is also somewhat old-fashioned in that it maps to desktop-style mouse plus overlapping window UIs, but not to modern mobile-style touch-based UIs.

@othermaciej
Copy link
Member

But I guess since they don't convey the size and such that a system font would have it's ok to make them just generic family names?

This is exactly the reason these are proposed as symbolic family names instead of special font keywords (as with system-ui).

@kojiishi
Copy link
Contributor

kojiishi commented Jul 15, 2019

Aren't system font's the mechanism for (2)?

Yes, that's s what I meant.

What's the status of that in other browser?

Blink added it a few years ago given web authors' requests, and app-looking sites (eg github) started using it.

@Crissov
Copy link
Contributor

Crissov commented Jul 15, 2019

If the use case is to adaptively mimic the OS look, I expect the OS to actually use these fonts for some part of its GUI. This would not be monospace but console or terminal, not serif but body or document, not rounded but caption or whatever.

Apple should probably be proposing font keywords to map to their HIGʼs Dynamic Font Variants, if the existing ones cited earlier do not suffice:

iOS, watchOS, tvOS

  • Large Title
  • Title 1
  • Title 2
  • Title 3
  • Headline
  • Body
  • Callout
  • Subhead
  • Footnote
  • Caption 1
  • Caption 2

macOS

  • Control Content
  • Label
  • Menu
  • Menu Bar
  • Message
  • Palette
  • Title
  • Tool Tips
  • Document Text (User)
  • Monospaced Document Text (User Fixed Pitch)
  • Bold System Font
  • System Font

I did not find New York being documented for any of that (yet), though.

Windows

  • Header
  • Subheader
  • Title
  • Subtitle
  • Base
  • Body
  • Caption

Furthermore, it is perfectly fine to map the the fonts in question to font-family keywords like serif, monospace and fantasy. If any website out there “fails” because its authors expected serif to mean Times [New Roman], it absolutely needs to “fail”. However, I cannot imagine how anyone would consider a slightly different font being used as “failing”.

@kojiishi
Copy link
Contributor

kojiishi commented Jul 30, 2019

If the use case is to adaptively mimic the OS look, ...

This is probably the most confusing part, but as I read more feedback and articles about system-ui, authors do not want to mimic the OS look. Before, I thought they do, but I'm revising my understanding now.

The article Using UI System Fonts In Web Design: A Quick Practical Guide explains that the goal is:

  1. Feel more like an app.
  2. To draw clear lines between the content and user interface.
  3. To use modern, beautiful fonts with zero latency.

and the emphasis on the item 3. It says using system UI fonts suffice this goal, namely Roboto, San Francisco, and Segoe.

Then this github article explains that, it turns out that using the system font of the platform does not suffice these goals on older and/or CJK versions of Windows. They prefer Segoe or Arial over decades-old Tahoma or poorly rendered Chinese fonts, and that stopped using system-ui. And this isn't only github saying.

In my new understanding, authors want modern, beautiful UI fonts, rather than the actual system UI fonts of the platform. I think it's more similar to a UI version of sans-serif generic font family rather than a different version of font: menu keyword. Authors want to use serif or sans-serif for UI, rather than exactly the same font family, style, and size of caption or status-bar of the platform.

I'm looking into updating Blink's system-ui to reflect the feedback, and this proposal looks like a good extension to it.

@Crissov
Copy link
Contributor

Crissov commented Jul 30, 2019

Thanks Koji, I think I understand the actual issue better now.

My problem then is with the ui- part of the proposed keywords, because apparently the fonts in question are not part of the system user interface (i.e. UI) at all. They are part of the OS vendorʼs flagship font super family, which is an essential and important part of their corporate design and identity. Seriously, please just drop it from the proposed keywords.

Hence, serif would mean give me some generic letters with serifs that look somewhat like everywhere else while system-serif or perhaps env(serif-font, serif) would mean give me some iconic letters with serifs that represent the look of the system/environment.

@othermaciej
Copy link
Member

For Apple, at least the serif (New York) and monospace (SF Mono) variants are used in parts of what we consider to be system UI, just not very often compared to sans. The serif variant is used when significant sections of published text are to be presented in a readable format. The mono variant is used when displaying code, a command-line terminal, or things of that nature.

(I am not aware offhand of a place that uses the rounded variant, but @litherum might know.)

@litherum
Copy link
Contributor Author

litherum commented Jul 31, 2019

The wallet app on iOS uses it as part of the UI:
024E1BDF-DAE8-459E-BACB-FCEDE2DA893F

And it’s used throughout the watchOS interface.

@jensimmons
Copy link
Contributor

I agree with Myles on this.

The usecase for system-ui, system-ui-serif, system-ui-monospaced, etc is different than the usecase for serif or monospaced.

By using a system-ui-* font, an Author is asking the browser to pick fonts that match the Operating System, knowing that if/when the operating system changes it's fonts, their website/app will be changed as well. It's stating an intention to blend into the OS.

By using a generic serif- or monospaced, and Author is saying, give me whatever is available in this browser, I can't really care what it is, just give me something that works in the serif/sans-serif/monospaced bucket of fonts. This is used most commonly as a fallback. Authors state: I want this fancy webfont I'm providing, or if that didn't download then please use this particular built-in-the-browser font, but if you don't have that font, then please at least pick some sans-serif font. In that usecase Authors are not expecting their project to suddenly then match the OS. In fact ,it's likely they do not want their project to suddenly match the OS' typography.

@bradkemper
Copy link
Contributor

I also agree with Myles and Jen, so far. But I would like guidance on what to author for fallback to cover Android, Windows, etc. Would there be system-ui-sans on some OS’s? Would I have font-family: system-ui-rounded, “Helvetia Rounded”, system-ui-sans, system-ui, san-serif;?

@litherum
Copy link
Contributor Author

litherum commented Aug 5, 2019

system-ui-rounded might map to Segoe Script or Segoe Print on Windows.

@svgeesus svgeesus added the css-fonts-4 Current Work label Aug 14, 2019
@svgeesus
Copy link
Contributor

@litherum wrote:

This choice is intentional, as these fonts are not intended to be document fonts for regular content. Instead, they represent the identity of the platforms themselves.

A little odd, but understood. But then "We've gotten requests to use these three fonts on the Web" should surely be met with "No, we don't want you to do that so we hid them" not "here is the CSS to do just that".

On a more detailed note, it is clear what happens with a browser that does not understand the new generic name. However, what happens if the browser does understand, say, system-ui-rounded but that doesn't translate to a suitable font on the platform. Should it

a) be skipped over, to the next font in the list, or
b) fall back to system-ui which is kind of the super-family?

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed system-ui-serif, system-ui-monospaced, and system-ui-rounded.

The full IRC log of that discussion <dael> Topic: system-ui-serif, system-ui-monospaced, and system-ui-rounded
<dael> github: https://github.com//issues/4107
<dael> myles: In latest version of macOS and iOS we've added 3 new fonts. You can see them in this issue
<dael> myles: These are new fonts but aren't like regular fonts. Don't show in font pickers and you can't get them in native apps by name. THere's a new codepath that causes these fonts and that's intentional
<dael> myles: These fonts are designed to match design language of OS. Not intended to be used in a document font. Not supposed to use in an essay.
<dael> myles: THere's nothing you can type in CSS to use these fonts which is unfortunate. Have heard requests to use them.
<dael> myles: Proposal is that b/c these fonts designed to match the system they should be added as sibs to system UI generic font family
<dael> myles: Might ask why not use existing generic font family. Reason is mechnically we can't b/c serif face is mapped to Times and if we change that we break the web. Need to be a new opt-in thing.
<dael> myles: New fonts shouldn't be used as a document typeface
<chris> q+ to ask why making these available on web if by design, they are not to be used in documents
<florian> q-
<dael> myles: What do you guys think about adding a way to get to these fonts?
<dael> Rossen_: Curious if another way is have them in static variables introducing for other system things like scrollbar thickness
<dbaron> I'm curious about whether we want the 'rounded' name in CSS, rather than our existing 'sans-serif' which it seems similar to...
<dael> myles: Mechanically fine. Confusing to authors b/c there's a way to ask for font-family from system.
<dael> chris: Why do this if whole point is not to use in word documents if you give css they can do specifically that. I'm curious why you hide in one hand and available on the other hand
<dael> leaverou: seems this is adding a very specific language feature that's OS specific. I don't htink we generally do that.
<dael> myles: One at a time. Chris question: This is interesting. On our platform there's a tension between system fonts and not. There isn't that on the web. Only distinction is they're font families that start with 'system-ui'. Can't stop people, but it's more important to give access then the design restrictions.
<AmeliaBR> dbaron, rounded isn't the same as sans; it's usually a sans font, but with rounded ends of strokes. Myles' naming system assumes that the default system-ui is sans-serif, so they haven't included a system-ui-sans.
<dael> myles: Trying to indicate these are system fonts by manner exposed to CSS and hoping that's good enough people will do the right thing. Things are either present or not in CSS 3.
<dael> chris: If an impl supports these keywords by on platform they don't map would it fallback to next font or system-ui? I'd like to propose clarify that case
<dael> myles: I see both arguments. Willing to go with WG desires
<chris> I can see merits in both options also. I just want it to be clear.
<dael> AmeliaBR: For the existing generic fonts I think we still require UAs to have something match those. I think we have exceptions for emoji generic font. If we have generic font names that are allowed to not match that would be a new way of talking about what a generic font is
<dael> AmeliaBR: One benefit of the suggestion to use environment variables is they then allow authors to decide what the fallback would be. Would have to think carefully of how that works with the way env/ variables work with replacing tokens and how that works with font-family fallback. Don't want to invalidate entire exporession
<dael> AmeliaBR: Fallbacks worth thinking about b/c don't have logical eq in other systems
<dael> Rossen_: Need to think through use cases.
<dael> Rossen_: We're a minute over. myles I don't think we'll get to resolve. Anything else you want to add before we end the call? Of course there's a call for people to read proposal and comment on the issue.
<dael> myles: It sounds like there's more to discuss so I hope this comes up on a future call
<dael> Rossen_: Will put it on next weeks call as well. Hopefully people can also discuss on github

@litherum
Copy link
Contributor Author

@svgeesus Given the design usage of these fonts, it makes more sense that they would fallback to system-ui than to be ignored in the font-family list. Therefore, a browser which supports these fonts but is running on a platform where they aren't relevant, should consider them synonyms for system-ui.

@AmeliaBR
Copy link
Contributor

Would it be helpful to consider this as a functional notation?

Like system-ui(rounded) to say "use a system UI font, rounded if you have one, otherwise the default system UI font", or system-ui(serif, monospace) to mean "use a system UI font, serif if you have it, otherwise monospace (otherwise the default). The function as a whole would be guaranteed to match a System UI font, but the style keywords inside create their own internal fallback list.

@litherum
Copy link
Contributor Author

litherum commented Aug 24, 2019

system-ui(serif, monospace) seems like overengineering the problem. This is exactly what the font family cascade is supposed to solve. It's true that, if we enforce the behavior suggested in #4107 (comment), it will be impossible to fall back from serif to rounded, but I can't think of a case in UI design where that's desirable.

As for syntax, I think there are a few contestants:

  • system-ui-rounded: Familiar to authors, yet possibly causing compatibility problems if anyone ever makes a real font with this exact name for some reason. (Note: This concern is relevant to every generic font family name.)
  • system-ui(rounded): Simple, yet possibly confusing because font family names are strings in every other context
  • env(system-ui-rounded): Conceptually pure, but exposes the platform-specific font name to the Web, if this environment variable was used in another context. E.g. content: env(system-ui-rounded).

@frivoal
Copy link
Collaborator

frivoal commented Sep 6, 2019

@jensimmons Thanks for the explanation.

I feel like a lot of this discussion has been derailed by people who are mad at Apple for not making their fonts more "open".

Apple has at some point during this conversation stated the main reason for wanting this is that designers told them these fonts were pretty and they wanted to use them. That's what brought the "if so, just give them access to the fonts". I don't think anybody was particularly mad at anyone.

Based on the rest of your comment, we can discard that line of reasoning, regardless of how we ended up there.

For the purpose of matching the design of the OS, I am still a bit skeptical, not of the intent, but of how well it is achieved by this: authors will not only need a keyword to match the fonts that are used in native apps, but also to match the platform conventions about where and how these fonts are used. And these conventions are OS specific, the resulting layout will be odd on different OSes than the one the author had in mind when designing the page/app. Given that these fonts are fairly generic, and that the current design trends are fairly flat / minimalist, then it may not be too jarring now. But if you comparing very different OS styles, the problem becomes more apparent: if an app is used with these fonts to look native on iOS, it probably would look alright on android, but it absolutely would not look native on enlightenment, windows XP, WebOS on LG TVs or nextSTEP, regardless of how you mapped the fonts: matching the look and feel of various OSes goes way beyond picking the right fonts. And giving that we don't have tools for that, I am concerned that this will result in making it easier for Authors to ship apps that look like iOS on all iOS browsers (of which there aren't very many), and like iOS-modulo-fonts everywhere else.

Now, maybe authors are going to do that anyway, so we should still ease that pain. But that's not the same as enabling portable apps that look native on any platform.

Actually more thinking is needed here because of SF Rounded... maybe a system-ui-alternative is in order

That seems to play into my concern: system-ui-alternative feels like fantasy generic family: if you don't know what you're going to get, there's not way to use this correctly. And if you build your design based on the assumption that you'll get apples rounded fonts because iphone, then who knows what it's going to do on other systems.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed system-ui fonts, and agreed to the following:

  • RESOLVED: Add them with the `ui-` prefix and make them not match if they're not available
The full IRC log of that discussion <emilio> Topic: system-ui fonts
<emilio> GitHub: https://github.com//issues/4107
<fantasai> This is my position: https://github.com//issues/4107#issuecomment-525824422
<emilio> myles: should we expose these like any other font like "Times new roman" or as a keyword like a generic font family, which other browsers would also implement and whose behavior would change across OSes
<emilio> ... ?
<emilio> myles: I'd prefer the later
<fremy> @myles: does adding this as a keyword add a fingerprinting method? is it worth it? ;-)
<emilio> fantasai: (explains her position above)
<emilio> fantasai: tldr it makes sense to have system-ui keywords, but they should be exposed also behind an actual name
<emilio> myles: It's impossible for us to determine because the fonts are nice or because they're systemy
<emilio> Rossen_: how are you going to determine it?
<emilio> ... expose it with a proprietary name and you're done
<emilio> koji: I think regardless of exposing them via the name I think there's use case for the keywords
<emilio> florian: I think they should be exposed by name, and if after that there's still users asking for that then we're done
<Rossen_> q?
<emilio> ... but just font families is not the only thing that emulating the system
<emilio> s/that/for
<emilio> myles: but it's a required part of matching the system, regardless of the rest of the design
<emilio> florian: it doesn't seem helpful to use system-ui vs. named, if you can just ua-sniff and set the font name
<emilio> dino: it may help authors in other systems too
<emilio> koji: we learned from system-ui that authors don't want the exact same font as the system
<emilio> ... on windows server a bunch of big pages didn't want the system font which was tahoma, they wanted segoe instead
<emilio> Rossen_: that's why when we released segoe we did it as a font not as a ui keyword
<emilio> florian: that's interesting, so this is appropriate in the sense that people wants ui fonts, but not the system ui font
<emilio> myles: so ui-serif rather than system-ui-serif?
<emilio> florian: if that's the use case that sounds fine
<emilio> nmccully: having a shorthand seems useful to guarantee that the font is current, is there, and not have to worry about the list of system fonts
<leaverou> q+
<emilio> myles: so it seems we're coalescing to add `ui-rounded`, `ui-serif`, `ui-monospace`, ...
<emilio> florian: I'd also also encourage apple to expose them by name
<emilio> nmccully: that seems useful
<emilio> myles: ok, we'll do both
<emilio> florian: less sure about *-rounded
<emilio> fantasai: what do we do for `ui-rounded` if there's no rounded font?
<emilio> ... maybe you have only arial and times?
<emilio> ... what do you fallback to?
<emilio> florian: I'd propose just for it not to match so it falls back to the next of the list
<emilio> leaverou: if we need more granularity to system ui fonts why mapping them to apple?
<emilio> ... why not system-ui-titletext?
<emilio> myles: when a platform has a different font for titletext we can consider that
<emilio> RESOLVED: Add them with the `ui-` prefix and make them not match if they're not available

@fantasai
Copy link
Collaborator

Note: CSSWG also recommended that fonts exposed via these keywords also be exposed by some normal font names, so that people don't start to use the keywords as a proxy for certain fonts (and then start to depend on that behavior).

@Crissov
Copy link
Contributor

Crissov commented Sep 20, 2019

Whatʼs the i18n story on the suggested values, especially re East (CJKV), South (Brahmic) and South-West (Semitic) Asian scripts? Some are always monospaced, some are always cursive, some are always rounded, some are always sans-serif …

Does each keyword resolve to different actual fonts depending on the characters?

@AmeliaBR
Copy link
Contributor

@Crissov The spec already says that generic fonts can be composite fonts, combining different families for different languages/Unicode ranges. That would presumably apply to these new values, too.

@Crissov
Copy link
Contributor

Crissov commented Sep 23, 2019

Indeed, but this does not quite answer my first question.

Does ui-monospaced always exist for CJKV? Does ui-rounded always exist for, say, Malayalam and Telugu?

@AmeliaBR
Copy link
Contributor

Does ui-monospaced always exist for CJKV? Does ui-rounded always exist for, say, Malayalam and Telugu?

Oh, I see. Yes, that would be different from the regular generic fonts, which are defined to always exist for all characters. I believe the agreement was that these keywords would fall back like regular font families, which means that if they only exist for certain Unicode ranges on the platform, then non-matching characters would fall back to the next value on the font stack.

@Crissov
Copy link
Contributor

Crissov commented Oct 26, 2019

No ui-sans-serif, though? system-ui may have serifs.

@AmeliaBR
Copy link
Contributor

No ui-sans-serif, though? system-ui may have serifs.

Agreed. We shouldn't assume which style system-ui uses. Fashions change & it may not always be a sans. Authors should be able to specifically ask for ui-sans-serif as much as asking for ui-serif.

@litherum
Copy link
Contributor Author

Please open a new issue for it :)

@AmeliaBR
Copy link
Contributor

Please open a new issue for it :)

Done: #4468 ([css-fonts] Add a ui-sans-serif keyword to go with ui-serif)

I also added [css-fonts] Inconsistency between monospace and ui-monospaced #4469 after reviewing the edits.

litherum pushed a commit that referenced this issue Nov 3, 2019
…cific names for standard font families

As per @fantasai's comment in #4107 (comment)
@litherum
Copy link
Contributor Author

litherum commented Nov 3, 2019

@fantasai

Note: CSSWG also recommended that fonts exposed via these keywords also be exposed by some normal font names, so that people don't start to use the keywords as a proxy for certain fonts (and then start to depend on that behavior).

Note added in 7f8d818

@fantasai
Copy link
Collaborator

fantasai commented Dec 3, 2019

@litherum I don't think that's quite the intention. Firstly, we have to make a clear distinction between generic family keywords and font names. Secondly, the concern in the note wasn't so much to control the system fallback in a particular way as to explicitly select certain desired fonts when they are available available rather than assuming a certain generic keyword always returns that desired font. Maybe something like

Note: User agents / operating systems are encouraged to also expose these standard font families by actual font-specific <family-name> values, in addition to the keywords given here, so that authors can request those specific fonts without making an assumption about a standard font family keyword mapping to a specific font.

I think you also need to clarify that these new values are keywords, like <generic-family>, not strings that can sometimes be left unquoted, like <family-name>. It might be worth giving them their own <system-family> value type.

@fantasai fantasai reopened this Dec 3, 2019
@AmeliaBR
Copy link
Contributor

AmeliaBR commented Dec 4, 2019

I think you also need to clarify that these new values are keywords, like <generic-family>,

If the changes suggested in #4442 are accepted, we can just include these keywords in <generic-family> and not worry about repeating the syntax details.

For the note:

For authors, we want to emphasize that using these keywords will get different results on each platform (though hopefully consistent within an OS), and the mappings may change over time. If they want specific fonts, they need to use specific font-family names. I think Myles' note covers that.

For user agents, the "encouragement" is to give authors that choice, by making fonts available either by keyword or by name.

It might be helpful to therefore break this into two separate notes:

Note: These standard font families are expected to exist on different platforms, but be backed by different fonts. The mappings may also change over time, as the operating system fonts change. Authors who wish to use specific fonts should specify them by font-family name, rather than with these keywords. The keywords are specifically intended for authors who wish their design to always match the current operating system typography.

Note: To make it possible for authors to specify fonts by font-family name instead of with these keywords (when that is their design intent), user agents are encouraged to expose the system font families by other, platform-specific, font-family names, in addition to the keywords given here.

@ExE-Boss
Copy link
Contributor

ExE-Boss commented Dec 4, 2019

We should change monospaced to monospace in the issue title, to avoid #4469 happening a second time.

@fantasai fantasai changed the title [css-fonts] system-ui-serif, system-ui-monospaced, and system-ui-rounded [css-fonts] system-ui-serif, system-ui-monospace, and system-ui-rounded Dec 5, 2019
@svgeesus
Copy link
Contributor

I'm seeing a Needs Edits label but am unclear on exactly what edit is outstanding.

@svgeesus
Copy link
Contributor

svgeesus commented Dec 3, 2021

Closing as these changes have been made, see for example https://drafts.csswg.org/css-fonts-4/#ui-rounded-def

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests