Skip to content

[css-text-decor-4] Definition of from-font value for text-decoration-thickness #13216

@jfkthame

Description

@jfkthame

https://drafts.csswg.org/css-text-decor-4/#valdef-text-decoration-thickness-from-font says that the from-font value means:

If the first available font has metrics indicating a preferred underline width, use that width, otherwise behaves as auto.

However, this seems wrong for line-through decorations, as OpenType fonts provide a separate yStrikeoutSize value in the OS/2 table which specifies the font's desired thickness for the strikeout stroke.

This may often match the font's underlineThickness (found in the post table), but there are some common fonts where the two metrics are different, including for example the Arial and Times fonts on macOS.

To more properly respect the metrics provided by the font designer, I suggest from-font should be defined to use the font's preferred underline width for underline and overline decorations (OpenType does not provide a separate overline-thickness metric), but to use the strikeout size for line-through decorations.

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