Re: [csswg-drafts] [css-inline-3] vertical-align: super and font metrics (#5225)

The CSS Working Group just discussed `[css-inline-3] vertical-align: super and font metrics`, and agreed to the following:

* `RESOLVED: Leave vertical-align super and sub as a may`
* `RESOLVED: font face descriptor for metrics should include super and subscript size and position and allow opting in to use font metrics`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: [css-inline-3] vertical-align: super and font metrics<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/5225<br>
&lt;dael> fantasai: Maybe should have Jonathan.<br>
&lt;dael> fantasai: 3 questions on this.<br>
&lt;dael> fantasai: Background is current impl of super and sub are not dependent on font metrics, use UA text ratio<br>
&lt;dael> fantasai: Second point is there are font metrics for super and sub script. Third point is they are not particuarly reliable<br>
&lt;Rossen_> q<br>
&lt;dael> fantasai: Should spec allow, disallow, or require using font metrics? Require I don't think we can do reasonably<br>
&lt;dael> dbaron: Gecko seems to use font metrics.<br>
&lt;dael> dbaron: Cross platform code calls into font metrics code to get super and subscript metrics. I haven't looked into specifics of what they return<br>
&lt;dael> fantasai: Spec allows but doesn't require it. If that's fine leave spec as-is<br>
&lt;dael> Rossen_: That'll satisfy the halfway solution dbaron described or the full solution<br>
&lt;dael> dauwhe: There are places css is used which are not browsers which would be pleased to use font information<br>
&lt;dael> florian: Source of concern. THat it should be accessible, yes. If you can get that with a keyword that does something different in browsers is not great<br>
&lt;dael> dbaron: Dug in further. WE hard code these to 0.2 x em height for sub and similar for super.<br>
&lt;dbaron> https://searchfox.org/mozilla-central/search?q=_OFFSET_RATIO&amp;path=&amp;case=false&amp;regexp=false<br>
&lt;dbaron> s/similar/0.34/<br>
&lt;dael> fantasai: So question is do we want to allow browsers or impl to use font metrics? If we're not requiring do we want to require a ratio and get interop? If we're disallowing should we spec a ratio?<br>
&lt;dael> fantasai: If not using font metrics should we add an ability to do so?<br>
&lt;dael> heycam: Saw proposal about overriding metrics in @fontface rule<br>
&lt;dael> faceless2: That was myles. If solving solve for all.<br>
&lt;dael> AmeliaBR: Have a feature in font variant that allows proper typographic sub and super from font. So is a way to access if you have a well defined font. hAven't played with it.<br>
&lt;dbaron> or more precisely, https://searchfox.org/mozilla-central/search?q=NS_FONT_%5BA-Z%5D*_OFFSET_RATIO&amp;path=&amp;case=false&amp;regexp=true<br>
&lt;dael> fantasai: That one will pull out glyphs and synthesize them if font doesn't have. Doesn't shift baseline so if you have nested super or an image as a super that's not a pure glyph you cannot do that<br>
&lt;florian> [more info on using font-variant for that sort of things at https://wiki.csswg.org/faq#styling-sup-and-sub-using-font-variant-position]<br>
&lt;dael> AmeliaBR: As an author it would be useful to be able to have vertical-align:super do something nice and typographic but I'd be very worried about backwards compat if we widely change the standard html 1 subscript style<br>
&lt;dael> fantasai: Ratios aren't consistent but close<br>
&lt;dael> fantasai: One option is we could allow font metrics, don't require, try and get alignment on the ratios.<br>
&lt;dael> fantasai: Then explore having the metrics spec via @fontface<br>
&lt;dael> faceless2: Solving without solving for superscript size is doing half the job<br>
&lt;dael> fantasai: That's against Fonts 5<br>
&lt;dael> fantasai: You want to file it?<br>
&lt;dael> faceless2: I think it's best solved in fontface rule<br>
&lt;dael> fantasai: But you haev to be able to access the size. vertical-align is only about baseline position. If you want to be able to size it you have to add to fonts 5.<br>
&lt;dael> faceless2: Yeah. I'll put a note<br>
&lt;dael> fantasai: Prop leave spec with a may, look into asking impl to align on fallback ratio, allow investigation of descriptors via font face<br>
&lt;dael> florian: Question, what we expect impl to do with the may is by default link to a fixed ratio and have an allow list of fonts with useful metric and use that if someone particularly cares about typography<br>
&lt;dael> fantasai: Seems like<br>
&lt;dael> florian: If we don't get guidance I wonder if people won't start to use metrics from fonts or cause more problems where I put something which looks wrong in Chrome and I corrected<br>
&lt;dael> fantasai: Author can always use explicit length or %. If they wanted something precise they can do that<br>
&lt;dael> Rossen_: Anyt time we define anything as may we define may have problem for authors<br>
&lt;dael> florian: Seems safe if we assume default is ratio and you opt in to better if it's that it's fine. If it applies in bad fonts for some browsers it will be weird.<br>
&lt;dael> fantasai: Maybe suspend until myles gets back<br>
&lt;dael> florian: I'm hinting at it's fine but adding a note what the may is for and that people should be careful when impl<br>
&lt;dael> fantasai: If you want to propose text that's fine<br>
&lt;dael> florian: I'll do that and run by myles<br>
&lt;dael> Rossen_: We can record resolution, myles can read and reopen when he comes back.<br>
&lt;dael> Rossen_: Progression of fantasai suggestions makes sense. Can't disallow so we need at least a may<br>
&lt;dael> Rossen_: Aligning on ratios that are as interop as possible is great.<br>
&lt;dael> Rossen_: Already a number of posts in issue from impl that desc how they get ratios. Encourage more of that so we can come down to something same.<br>
&lt;dael> Rossen_: First resolution should be leave vertical-align super and sub as a may<br>
&lt;dael> Rossen_: Objections?<br>
&lt;dael> RESOLVED: Leave vertical-align super and sub as a may<br>
&lt;dael> Rossen_: I don't know that we can have a resolution about ratios without actual ratios<br>
&lt;dael> fantasai: Yeah<br>
&lt;dael> Rossen_: Leave that open<br>
&lt;dael> fantasai: Okay<br>
&lt;dael> Rossen_: Last one is with @fontface<br>
&lt;dael> fantasai: I think font face descriptor for metrics should incl super and subscript size and position and allow opting in to use font metrics<br>
&lt;dael> Rossen_: Sounds good. Objections or comments?<br>
&lt;dael> RESOLVED: font face descriptor for metrics should include super and subscript size and position and allow opting in to use font metrics<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5225#issuecomment-665338110 using your GitHub account

Received on Tuesday, 28 July 2020 23:04:18 UTC