Skip to content

[css-text-decor-4] how should text-underline-offset be pixel-snapped? #13202

@dbaron

Description

@dbaron

In #12696 we just resolved on rules for pixel snapping of text-decoration-thickness.

However, I think it's likely that we also want pixel snapping of text-underline-offset, as we discussed a little bit in that discussion. This is because we want to ensure that the visual distance between the text and the underline is consistent between lines even if the lines vary in their subpixel position offset relative to the device pixel grid.

However, the complication here is that font rasterization may or may not care about subpixel position in the vertical direction. (I think this varies by operating system, though the details have likely changed since I last investigated it more than a decade ago!) And it's possible that if font rasterization is affected by subpixel position then we don't want to do this.

As @fantasai pointed out in the #12696 discussion we also probably also don't want the "round away from zero" rule for this. But I think in at least some cases we do want device pixel snapping here.

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