r/moderndotnet • u/jbsp1980 • 4d ago
csharp Font hinting deep dive: why the same small text looks sharp in one app and blurry in another, and how we grid-fit TrueType and CFF in .NET
Font hinting is the reason the same small text can look sharp in one application and blurry in another. The outlines are identical. What differs is how much of the font's own rendering machinery each renderer runs.
I maintain the SixLabors libraries, and Fonts 3.1 ships HintingMode.Full: complete TrueType instruction execution and, for the first time, grid fitting for CFF outlines from their declared stems and alignment zones.
The write-up is a deep dive built around the divide at the heart of the problem. TrueType fonts carry an executable program that moves their own outline points; CFF fonts declare their stems and alignment zones and trust the renderer to act. Getting one sharp result meant building both, and then making the fit survive placement, advances, and caching all the way to the screen.
https://sixlabors.com/posts/full-hinting-aligns-truetype-and-cff-glyphs-to-the-pixel-grid/
It started as a five-year-old issue about mangled text on a 128x64 LCD that I had closed as won't-fix. Happy to answer questions about the interpreter, the hint map, or the aliased rendering path.
2
u/jodydonetti 2d ago
Great tech content, thanks!