Skip to content

[css-fonts-4] Should the OpenType spec dictate the acceptable values for variable font CSS properties? #1531

@drott

Description

@drott

In the "Matching Font Styles algorithm", for style matching, the algorithm is defined to perform this first step:

If the matching set includes faces with italic values containing the mapped value of italic, faces, then faces with italic values which do not include the desired italic mapped value are removed from the matching set.

What does

mapped value of italic

mean in this case?

Then the algorithm talks about searching along the italic axis:

Otherwise, italic values above the desired italic value are checked in ascending order followed by italic values below the desired italic value, until 0 is hit. Only positive values of italic values are checked in this stage.

However, as far as I read it, the font-style property, as well as the font-style property descriptor do not allow specifying an italic axis range, or an arbitrary italic value between 0 and 1 on the italic axis.

The grammar for the font-style property descriptor is

normal | italic | oblique [ <angle> | <angle> <angle> ] ?

And if I interpret the grammar right, something like
font-style: italic 0.5 0.7;
would be invalid.

In order to define italic ranges, shouldn't this be:

normal | italic [ <italic_amount> | <italic_amount> <italic_amount> ]? | oblique [ <angle> | <angle> <angle> ]?

Similarly, currently the font-style property's grammar is:

normal | italic | oblique <angle>?

But shouldn't this be:

normal | italic <italic_amount>? | oblique <angle>?

to be consistent with the stretch matching part of the algorithm?

CC @litherum, @PeterCon

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions