W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2018

Re: [csswg-drafts] [css-fonts] font property descriptors for variable fonts

From: CSS Meeting Bot via GitHub <sysbot+gh@w3.org>
Date: Wed, 11 Apr 2018 14:42:53 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-380477779-1523457771-sysbot+gh@w3.org>
The Working Group just discussed `font property descriptors for variable fonts`, and agreed to the following resolutions:

* `RESOLVED: Add an auto keyword to the appropriate font descriptors that has the effect of the following: 1) for font selection purposes the font is selected as if the appropriate initial value is chosen. 2) for variation axis clamping, clamping does not occur`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: font property descriptors for variable fonts<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/2485<br>
&lt;dael> dbaron: The way @font-face works is what you're doing is you're adding a font-face to library of fonts browser can consider. Has descriptors, one is source, and the rest describe the thing at the end of the source. Many cases they have default values. Better to spec a font-family. If you don't do either it's 400, style default sto normal. etc.<br>
&lt;dael> dbaron: Useful because means the UA can decide if to download based on these things. Then we introduced variable fonts which have maybe more hten one font-weight. The interesting part is that they can have variation axes that corrispond to these descriptors.<br>
&lt;dael> dbaron: Spec says you're defining variable font with @font-face rule and you don't spec a weight your font is used for 400 according to the spec.<br>
&lt;dael> florian: Other fotns for other weights?<br>
&lt;dael> dbaron: I don't want to get into that part.<br>
&lt;dael> dbaron: You can write 4 @font-face rule and now your variation font is limited to 4 weights.<br>
&lt;dael> myles: Context: key problamatic pieces is descriptors are defined to take on initial value. You covered that. Other pieces is that whatever is inside those descriptors clamps the effective range and in thinital value says you clamp to a range of size 0 which is not what you want.<br>
&lt;ChrisL> @font-face {     font-family: MyVariableFont;     src: url(fonts/MyVar.ttf);     font-weight: 65 490; }<br>
&lt;dael> myles: When I impl this in webkit I discovered this is a problem because if it was selected and doesn't have a descriptor you're forced to default value. I impl that if there's no descriptor the clamping would not occur.<br>
&lt;dael> myles: Spec deosn't say to do that and we're the only browser that does.<br>
&lt;dael> dbaron: FF doesn't ship, would like to soon, and recognizes this isn't good. But from Jonathan's understanding os webkit is that it makes it hard to figure out what to download. His impression is it interferes with the decision on what to download.<br>
&lt;dael> ChrisL: In font's 4 this is changed and you can give a range. BUt we don't want to force 1-999 because there's a weight axis. THat's why I proposed an auto value which gives you range for variable and single for traditional.<br>
&lt;Joel> myles: About opening the issue for @supports, should I create it on https://github.com/w3c/csswg-drafts? (I'm not familiar with this repo and guidelines though)<br>
&lt;dael> myles: If the goal is I have multiple fonts and want to download the right they're distinguished between the descriptors. If they both have the descriptors then they'll know it as the right font. So I think the problem you described isn't.<br>
&lt;dael> dbaron: Are there cases where font-fallback says tihs weight isn't close enough I'll fallback.<br>
&lt;dael> TabAtkins: No. You might synth off of it but you'll stay. If you have the bold varation use that first regardless of the weight it was declard for.<br>
&lt;dael> myles: Distinction webkit drawn between not present and taking initial is only relevent for when there's 1 rule that shares a family. If there's 2 rules the descriptors will be there.<br>
&lt;dael> TabAtkins: YOu put 2 font faces to construct a family. One is weigth 400, the other 700. You tell it to use 500 and it'l select 400 font. Will variations happen at that point?<br>
&lt;dael> myles: In you case bad things would happen, we'd select on of them and then we'd clampt o a 500:500 range.<br>
&lt;dael> myles: But if author writes a font-face urle they wouldn't write that.<br>
&lt;dael> dbaron: You can use fontface rules to provide part of what a font provides. You can only use a certain unicode range.<br>
&lt;dael> myles: That's reason for clmaping<br>
&lt;dael> ChrisL: You can say I only want to use a rescrticted range of what it can do. But if you don't put one in it can do waht it can do.<br>
&lt;dael> florian: Question. When you're doing this clamping etc. can you also have withing the variablility I was to use 200-400 but map to 400-600<br>
&lt;dael> myles: Different discussion. THere's a different open issue<br>
&lt;dael> TabAtkins: On the situation I desc a viariant font with not @font-face declaration and another with a weight. You say select the 450 does selection occur there?<br>
&lt;dael> myles: Yes<br>
&lt;dael> dbaron: Other meta point is this is a feature we've done a good job on coordinating on shipping at the same time, which is good. but that makes this high priority.<br>
&lt;dael> florian: Variable font dow't have a descripto and you have another on 700 and you say 450. Instead you say 699 and you still get the fist one.<br>
&lt;dael> TabAtkins: We should switch to auto where it means the same as the initial values but it does not cause any clmaping.<br>
&lt;dael> florian: When you ask for 699 it's not a range. The variable would not be matched because it's default to 400. If you drop the 400 you do the same thing. But if you're close to 400 that you would get the font you get it and draw it at the requested weight.<br>
&lt;dael> fantasai: If you wanted 699 off this font?<br>
&lt;dael> florian: You draw the range.<br>
&lt;dael> myles: The descriptor that covers everything is a better match.<br>
&lt;dael> dbaron: What TabAtkins said made sense. Does myles agree?<br>
&lt;dael> myles: I think that's acceptable.<br>
&lt;dael> dbaron: Is it waht safari does?<br>
&lt;dael> myles: Almost. Close. With TabAtkins proposal an @font-face block could say font-weight auto. In my impl that's a parse error.<br>
&lt;dael> fantasai: I still think it's a little weird that you say font range is auto which means everything and it's able to do weight 699 and we pull 700.<br>
&lt;dael> TabAtkins: We don't know it can do 699 so we don't download it and and won't know it can do 699 until we download.<br>
&lt;dael> myles: Most fonts on the web don't have variable.<br>
&lt;dael> ChrisL: If yousay auto you should know that it's variable since nothing is tagged as auto.<br>
&lt;dael> myles: Maybe they should write 0-999.<br>
&lt;dael> ChrisL: I'd rather an opt in keyword and not have to write the whole range.<br>
&lt;dael> dbaron: I'ts better to write 0-999 because you know it's a variation. I think auto where it means 400 but don't clamp is a good way to transition to the word with variable fonts.<br>
&lt;dael> myles: SHould authors be able to write font-weight:auto<br>
&lt;dael> dbaron: It'll be possible but we shouldn't suggest it.<br>
&lt;dael> fantasai: I agree with ChrisL it's not nice to make authors write 0-999 and give an all keyword.<br>
&lt;dael> myles: Most varaiable fonts don't support 0-999.<br>
&lt;dael> fantasai: But if authors don't want to think about it and just want 0-999 it's awk.<br>
&lt;dael> ChrisL: It's like for unicode where they don't write the range.<br>
&lt;dael> Rick: As a font user it's hard to determine range<br>
&lt;dael> J...: The fotns as they're developing have quite different ranges. We're only dealing with weight because it's the only variable range that maps to CSS. Maybe with font-weight we want people to put in the effort to put in the low and high because it also supports wanting to subset the range.<br>
&lt;astearns> s/J.../jpamental<br>
&lt;dael> fantasai: But the browser gets a request for 100 and the range is 200-800 I'm still going to get the font. Unless there's another font that supports 100 I'm still going to get that font and I'll use the lowest number. In terms of which file will I download it doesn't matter. Only time it matters is if there's another font that covrs the range.<br>
&lt;dael> myles: Let's say there's an auto and you can say font-weight:auto and it has the same value if the descriptor is missing without the clamp<br>
&lt;dael> TabAtkins: For matching it acts like the values we spec.<br>
&lt;dael> majidvp: And no clamping.<br>
&lt;dael> myles: prop: Add an auto keyword to the appropriate font descriptors that has the effect of the following: 1) for font selection purposes the font is selected as if the appropriate initial value is chosen. 2) for variation axis clamping, clamping does not occur<br>
&lt;dael> astearns: Obj?<br>
&lt;dael> RESOLVED: Add an auto keyword to the appropriate font descriptors that has the effect of the following: 1) for font selection purposes the font is selected as if the appropriate initial value is chosen. 2) for variation axis clamping, clamping does not occur<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2485#issuecomment-380477779 using your GitHub account
Received on Wednesday, 11 April 2018 14:42:58 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:28 UTC