You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-fonts-5] font-size-adjust and font metrics overrides #8967
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,
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.
Related, but I think we discussed this: Does the spec already clarify the case of how the size-adjust@font-face descriptor interacts with font-size-adjust?
PS:
When I tested, Gecko applied the metric override after font-size-adjust.
Do you mean by that, the font size is first scaled (up, 2.0x in your example), then he ascent/descent overrides are applied?
Related, but I think we discussed this: Does the spec already clarify the case of how the size-adjust@font-face descriptor interacts with font-size-adjust?
The font-size-adjust property is applied after the size-adjust descriptor.
Note: The consequence of applying font-size-adjust after size-adjust is that size-adjust appears to have no effect.
PS:
When I tested, Gecko applied the metric override after font-size-adjust.
Do you mean by that, the font size is first scaled (up, 2.0x in your example), then he ascent/descent overrides are applied?
Sorry to have ignored this issue; I try to keep on top of issues tagged css-fonts-4 but don't check the css-fonts-5 tag often enough.
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.
It sounds as if there is a desire to change the order of operations so that the spec says to apply font-size-adjust first, and then the overrides are applied? Which would align the spec to what Blink and Gecko currently do, and what the WPT is testing for?
It sounds as if there is a desire to change the order of operations
I intend to clarify the order of operations rather than change the existing order. The current description makes it hard to figure out the order between font-size-adjust and font metric overrides.
so that the spec says to apply font-size-adjust first, and then the overrides are applied?
Yes.
Which would align the spec to what Blink and Gecko currently do,
Yes. That is aligned with the current behaviors of Gecko and Blink. (FYI, WebKit does not support font metric overrides yet).
The font-size-adjust property is applied after the size-adjust descriptor.
This sounds like the size-adjust descriptor was applied first, and then the font-size-adjust property was applied. However, my proposal and the current browser's implementation sound the opposite. (i.e., font-size-adjust first, then the descriptor)
I think the spec description above is a bit misleading. When the size-adjust descriptor and the font-size-adjust property are co-used, a conflict is caused since they both define the same font scaling factor. The spec resolves the conflict by preceding font-size-adjust over the size-adjust descriptor. (i.e., font-size-adjust overrides size-adjust). Actually, that does not mean font-size-adjust is applied after size-adjust is applied.
On the other hand, font-size-adjust and metric overrides define different font scaling factors, and they can be co-used. But we need to clarify the order in which they apply. (This is what we are doing here.) The current Gecko and Blink apply font-size-adjust first and then do the font metric override descriptor to the adjusted font size.
I don't know the authors' original intention and whether we have a general ordering rule to resolve this conflict. But I think we can clarify the order in the spec, adopting the current browser implementations if we agree.
So, what is the next step? Do we need to bring this issue to the CSS WG meeting and get it resolved there? Or can we close this issue by simply accepting a pull request if I make the edit on the spec?
Activity
drott commentedon Jul 6, 2023
Related, but I think we discussed this: Does the spec already clarify the case of how the
size-adjust@font-facedescriptor interacts withfont-size-adjust?PS:
Do you mean by that, the font size is first scaled (up, 2.0x in your example), then he ascent/descent overrides are applied?
shivamidow commentedon Jul 7, 2023
I think so. The level 5 draft mentions
Yes. Here is the test.
svgeesus commentedon Dec 13, 2023
Sorry to have ignored this issue; I try to keep on top of issues tagged
css-fonts-4but don't check thecss-fonts-5tag often enough.@shivamidow @drott
It sounds as if there is a desire to change the order of operations so that the spec says to apply font-size-adjust first, and then the overrides are applied? Which would align the spec to what Blink and Gecko currently do, and what the WPT is testing for?
shivamidow commentedon Dec 13, 2023
I intend to clarify the order of operations rather than change the existing order. The current description makes it hard to figure out the order between
font-size-adjustand font metric overrides.Yes.
Yes. That is aligned with the current behaviors of Gecko and Blink. (FYI, WebKit does not support font metric overrides yet).
font-size-adjust-metrics-override.html tests the behavior.
https://wpt.fyi/results/css/css-fonts/font-size-adjust-metrics-override.html?label=experimental&label=master&aligned
shivamidow commentedon Dec 13, 2023
I see where the confusion is coming from.
This sounds like the size-adjust descriptor was applied first, and then the font-size-adjust property was applied. However, my proposal and the current browser's implementation sound the opposite. (i.e.,
font-size-adjustfirst, then the descriptor)I think the spec description above is a bit misleading. When the
size-adjustdescriptor and thefont-size-adjustproperty are co-used, a conflict is caused since they both define the same font scaling factor. The spec resolves the conflict by precedingfont-size-adjustover thesize-adjustdescriptor. (i.e., font-size-adjust overrides size-adjust). Actually, that does not meanfont-size-adjustis applied aftersize-adjustis applied.On the other hand,
font-size-adjustand metric overrides define different font scaling factors, and they can be co-used. But we need to clarify the order in which they apply. (This is what we are doing here.) The current Gecko and Blink applyfont-size-adjustfirst and then do the font metric override descriptor to the adjusted font size.I don't know the authors' original intention and whether we have a general ordering rule to resolve this conflict. But I think we can clarify the order in the spec, adopting the current browser implementations if we agree.
shivamidow commentedon Jan 4, 2024
So, what is the next step? Do we need to bring this issue to the CSS WG meeting and get it resolved there? Or can we close this issue by simply accepting a pull request if I make the edit on the spec?
svgeesus commentedon Jan 5, 2024
How about you propose some specific text, as a PR, and we get it reviewed and merge if there is consensus?
shivamidow commentedon Jan 5, 2024
O.K. I will come up with a PR.
[css-fonts-5] font-size-adjust precedes font metrics overrides w3c#8967
[css-fonts-5] font-size-adjust precedes font metrics overrides #8967