Skip to content

[css-fonts-4] [varfont] Consider not clamping single values in @font-face descriptors #1306

@litherum

Description

@litherum

Currently, @font-face blocks are used like:

@font-face {
    font-family: "MyCoolFont";
    font-weight: 700;
    src: url("MyCoolFont.ttf") format("truetype");
}
<div style="font-family: 'MyCoolFont'; font-weight: 800;">

Let's pretend this web author then replaces their font file with a variable font which support weight ranges 600 - 900. In this situation, the page wouldn't look different, because the font-weight descriptor will clamp the request to the range [700, 700], so the value applied would be 700, which is the same as what the original file would have rendered.

However, the request was for weight 800, and the font supports weight 800. Perhaps we should consider font-weight: 700 distinctly from font-weight: 700 700 in the @font-face block. This would mean that web authors would have to opt-in to the clamping behavior by setting an explicit range.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions