Skip to content

TrueType hinting distorts x-height in FreeType2. Reliable future proof-solution: use CFF for UI fonts. #880

Description

@xanadu3

I'm using the Inter Display font for the system UI on a 163 ppi screen.

I use it on both Linux and Haiku. Both systems use FreeType 2 as their rasterizer and exhibit the same behavior.

The TrueType hinting engine lowers the middle strokes of letters such as E, A, B and R, resulting in visibly distorted glyphs. Since the CFF hinting engine is designed to preserve the original glyph shapes as faithfully as possible, it is a technically more elegant and more future-proof solution for UI fonts at 163 ppi and above.

On Haiku, the TrueType version was replaced with the CFF OpenType version in the official HaikuDepot package a couple of years ago, and the CFF version has been the default since then.

This is not a bug report, but advice for users and distributions: for static fonts on high-PPI displays, prefer CFF OTF because of the more accurate hinting and rasterization strategy.

An additional benefit is that the FreeType CFF hinter allows stem darkening (enable it with FREETYPE_PROPERTIES="cff:no-stem-darkening=0"), a FreeType feature that does not exist for TrueType fonts.

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions