[csswg-drafts] [css-fonts-5] font-size-adjust and font metrics overrides (#8967)

shivamidow has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-fonts-5] font-size-adjust and font metrics overrides ==
Related spec: https://drafts.csswg.org/css-fonts-5/#valdef-ascent-overridedescriptor-percentage

The spec document describes the percentage value for the font metrics overrides as follows.
> '\<percentage\>'
>    The corresponding metric is replaced by the given percentage multiplied by the used font size.

That description sounds a bit obscure to me. What is the used font size? Does it mean the specified size by `font-size` or  the computed size or the actual size to render (i.e., effective size) or something else?

The spec also needs to clarify how the font size should be adjusted when font metrics overrides and font-size-adjust are simultaneously applied. For instance,

```css
@font-face {
  font-family: TestFont;
  src: serif;
  ascent-override: 100%;
  descent-override: 50%;
}

.size-adjusted {
  font: 20px TestFont;
  font-size-adjust: 2.0;
}
```

When I tested, Gecko applied the metric override after font-size-adjust. So, Chromium is following the Gecko's behavior [1], but I hope the spec would be improved here.

Proposed solution:
Change the wording like the following;
`The corresponding metric is replaced by the given percentage multiplied by the effective font size.`
or
`The corresponding metric is replaced by the given percentage multiplied by the font size after adjustment.`

[1] https://chromium-review.googlesource.com/c/chromium/src/+/4305200

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/8967 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 15 June 2023 01:44:06 UTC