Skip to content

Safari snaps fonts to whole pixel sizes #1

@exogen

Description

@exogen

Unfortunately for TightenText, Safari rounds font sizes to whole pixels as soon as it crosses the half-pixel boundary. This leads to a significant jump in how wide the text is, and also potentially means the resulting text is smaller than the developer's desired minFontSize (if, say, they want it to be 0.97 ems, and that results in a font size of 15.49px, Safari will render 15px text).

Some options:

  1. Add a disclaimer for Safari.
  2. Detect pixel rounding, refuse to cross the half pixel boundary if using such a browser.
  3. Scale the font some other way (e.g. transform) that would achieve the same visual effect as the font-size change?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions