Re: [csswg-drafts] [css-fonts] Don't require browsers to always match every generic font family to a concrete font family (#4442)

> > WebKit (and other browsers too?) will consider this kind of signal when we "fall off the end" of the font-family list and have to pick a font for the content but can't use any of the fonts in the specified list.
> 
> Can you elaborate on this? I don't understand what you mean - are you saying that if the author puts `serif` at the end of their stack, but they use a character not mapped by the font that WebKit assigns to `serif`, it'll still influence what _additional_ fonts WebKit looks for to find a mapping for the character?

Our impl is very similar to what @litherum explained; generic families (except `system-ui`) are mapped to single font, so it is not guaranteed to match. We even allow users to change the mapping.

Regardless generic families are used or not, we have a logic to run when all specified families are exhausted and still the glyph is missing. This logic doesn't have a good name, I think this is what @litherum called "fall off the end". I usually call it "system fallback" but this isn't probably a common name, I think you called it "last resort font" (in broad sense, not the "LastResort" font unicode.org provides), this is probably more common.

A discussion we had before was that, during this "fall off the end or system fallback or last resort font in broad sense" process, we may find multiple candidates, and the idea was that generic families in the `font-family` property can provide a hint to which candidates we want to choose. `font-weight` or `font-style` can also provide more hints.

Back to the original discussion, I don't have strong opinion on whether the spec should encourage authors to use generic families or not, I'm fine with it or without it, but I agree with @litherum that more hints from authors could improve our font choice.

-- 
GitHub Notification of comment by kojiishi
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4442#issuecomment-547244218 using your GitHub account

Received on Tuesday, 29 October 2019 03:49:48 UTC