-
Notifications
You must be signed in to change notification settings - Fork 681
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] Do generic fonts resolve to a single font face value? #1736
Comments
Should the selection of a generic font not depend on language? It seems like there could be glyph availability issues. |
Oh, actually this is totally bogus, because the font matching algorithm explicitly allows this. That said, I think we should tidy up some of the definition of generics to make that clear. |
@kahsieh it seems like theoretically you could behave identically to But yes, see previous comment. |
So, things that to me imply a single font:
This is somewhat ambiguous, but without first reading the font matching algorithm closely I'd understand this to mean that they map to five actual fonts (see especially the parenthetical!). I'd probably right here introducing generics that user agents don't need to map to five fonts, and each can map to more than one based on element language and/or unicode range.
(And similar statements for other generics.) This to me implies that a font is used to represent the generic font family, because I'd view representation as an exclusive act in this context. |
I read the parenthetical to say the exact opposite - they don't necessary map to five distinct actual fonts (because they might map to a collection of fonts). |
Rather than thinking of the generics as equivalent to a system (Which maybe should be a font-face descriptor as well, kind of the opposite of But either way: if experienced web-spec-readers are getting confused and debating semantics, then the language could clearly use some clarification. How about:
|
@kahsieh Oh, don't get me wrong, I'm well aware this is totally relied upon, I guess I was just expecting something way more evil (like using Times New Roman or whatever for all non-CJK characters). |
@gsnedders Of course! Just noting the use case should there be more interest in adding it to |
@kahsieh Since you seem to know more about the topic than I do, could you start the separate issue about |
@AmeliaBR's proposed text is the right direction, but we should go even further: a UA should be allowed to take any signals into account when selecting these fonts, including but not limited to This is a place where the UA should be able to just Do The Right Thing™. |
@litherum then we need changes in the font matching algorithm too |
Not if we're just discussing for mapping |
@litherum See step 2:
I guess we can argue that doesn't need to change because as a "may" you are actually already allowed to do anything. That said, that's as much a requirement as @AmeliaBR's text above (similarly using "may"). |
How about this change to the first para from @AmeliaBR (I lke that text in general, but my rewording takes into account the comment from @litherum
Same language in fonts-4, except there are nine generics. |
Did anyone like/dislike my proposed rewording? |
I like it, but putting the list in normative text makes it seem like anything not in the list is disallowed. I think we should go with Chris’s text but either add a “etc. or “among others” or something like that. Alternatively we could pull out the parenthetical and put it in a note. |
Looks good to me, with Myles' suggestion of making it clear that the parenthesis is a "for example" list, not a definitive one. |
So a few thoughts here:
|
The Working Group just discussed
The full IRC log of that discussion<dael> Topic: [css-fonts] Do generic fonts resolve to a single font face value?<dael> github: https://github.com//issues/1736 <dael> Chris: Amelia suggested wording. I modified that based on myles' comments. Seemed generally liked, but myles wanted it not to be an exclusive list. Seems okay to me. dbaron commented recently. <dael> dbaron: Yeah. I think if we're going to say it's okay to choose a different font for same unicode code point in same lang with same font we should have an idea of why we want to do that. <dael> Chris: Yes. <dael> dbaron: And user preference didn't seem to be a great desc of the reasons. <dael> Chris: TO me it seemed more likely an impl may want to avoid ransom note effects or to avoid font family switches. <dael> Chris: HOw should we proceed? Text I proposed has been there since Sept 2017. No one has said they didn't like. There were 2 lgtm from Amelia and Myles. <dael> astearns: looks good comments only had the one cavet that they would like it to be "for example" <dael> astearns: And dbaron are you okay with the existance of this as is or do you want more motivation? <dael> dbaron: If it is flexible I'd rather it not be tied to that list so I guess for example is okay. That makes it more flexible. I don't have strong feelings here. I'm not crazy about flexibility but if is flexible for example is better. <dael> Chris: And it's allowing generic to be made from composites . <dael> dbaron: But that would be allowed without the varients in there. THat's the result of code point. <dael> Chris: I think taking it back to initial comment that does resolve that Latin and Japanese aren't expected to be the same. <dael> Chris: I propose that I put the modified language in the spec and we see if there's anything left ot do. <dael> astearns: sgtm. Obj to putting this parenthetical as a for example into the spec? <dael> RESOLVED: Take Chris's language in https://github.com//issues/1736 into the spec as an example |
@gsnedders Checking you are happy with the eventual resolution |
See https://drafts.csswg.org/css-fonts-4/#generic-font-families and https://drafts.csswg.org/css-fonts-4/#font-matching-algorithm
Are:
<p style='font-face: serif' lang='en'>Lorem ipsum dolor sit amet</p>
<p style='font-face: serif' lang='jp'>Lorem ipsum dolor sit amet</p>
Guaranteed to render the same? The spec seems to imply, without directly stating, in various places that the generic font is a specific, probably user-specifiable font-face, which implies that they should. This is, I believe, not true in any browser: a Latin font is selected for the former, a Japanese font for the latter.
(Ref web-platform-tests/wpt#6926 which made me realise this is unspecified behaviour.)
The text was updated successfully, but these errors were encountered: