8000 [css-fonts-5] font-size-adjust and font metrics overrides · Issue #8967 · w3c/csswg-drafts · GitHub 8000
[go: up one dir, main page]

Skip to content

[css-fonts-5] font-size-adjust and font metrics overrides #8967

@shivamidow

Description

@shivamidow

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,

@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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0