8000 [css-fonts] Font matching algorithm; issue with weight selection · Issue #1701 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-fonts] Font matching algorithm; issue with weight selection #1701

@neilj

Description

@neilj

This issue is related to the font-weight section of the font-matching algorithm (https://github.com/w3c/csswg-drafts/blob/master/css-fonts/Fonts.html#L3383).

When an exact match is not available for the specified weight, I believe the browser should instead choose the nearest available weight (with rules for tie-breaks obviously). This is very useful when you need to have multiple fallback fonts for different platforms, and one font has weights 400,500,700 (say), and another 400,600,700. For semi-bold text I want 500 from the first font, or 600 if the second font. The logical way to do this is to specify font-weight: 550, however with the current algorithm this would map to 700 rather than 500 in the first font. There is no way to specify this choice with the current algorithm.

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

      0