CFF (in OTF) font rendering issue on Windows only

Roger Khoueiri 20 Reputation points
2026-08-14T14:51:15.28+00:00

We have a situation where some fonts render with artifacts only when rendering them on Windows.

The same test works perfectly on Linux, macOC, iOS, Android and curiously, on Windows but only when rendering the glyphs using FreeType.

Might be an indication that the font rendering subsystem on Windows lacks proper support for the cases in these fonts. (I tried rendering with GDI, GDI+ and DirectWrite - all the same.)

Here's a small test that can be used to demonstrate. The link to the test files (and zip file) https://apryse-my.sharepoint.com/:f:/p/roger_khoueiri/IgCiiO8vCZFlSpvNzwq-XHAnAUfkHbt-7BihC-uidMyEXBY?e=OcIEo9 contains a very simple test. Extract the content to a folder then:

**
On Windows**, double-click font-test.html to open in Edge, Chrome or FireFox. Zoom out and in to see the artifacts in the rendering of some of the letters at different zoom levels.

**
On Linux**, the same test renders all the letters fine.

In addition, on Windows, you can double-click the .otf font files to preview them in Windows font viewer. You will see the artifacts at different pt sizes. For example in cff1.otf, notice the capital T at pt sizes 12, 18 and 24, and in cff2.otf, notice the letter e at the same pt sizes.

The font files are perfectly valid and when rendering the glyphs using FreeType they are correct.

If Microsoft can provide a fix for rendering these on Windows that would be great.

This is an issue that has been happening on Windows with similar fonts for a number of years now.

e.g.:
Screenshot 1.png

Thanks,
Roger

Windows development | Windows API - Win32
0 comments No comments

Answer accepted by question author
Taki Ly (WICLOUD CORPORATION) 4,440 Reputation points Microsoft External Staff Moderator
2026-08-17T07:45:33.9166667+00:00

Hello @Roger Khoueiri ,

Thank you for the detailed report and the sample files. I spent some time looking at cff1.otf and cff2.otf, and I would like to share what I found.

Inspecting the CFF outlines directly, the affected glyphs appear to be built from overlapping or self-intersecting contours. The capital T in cff1.otf, for example, is two separate rectangles (stem and crossbar) that overlap near the top rather than a single merged outline, and the e glyph in cff2.otf is a self-intersecting contour. The contours also use clockwise winding, while the PostScript/CFF convention for outer contours is counter-clockwise, and there are no per-glyph hints.

These shapes still fill correctly at large sizes, but when the Windows CFF rasterizer grid-fits at small sizes, the coincident edges of the overlapping contours can round to slightly different pixel boundaries, which seems to be what exposes the spikes and notches. FreeType appears to be more tolerant of this geometry, which may explain why it renders cleanly.

I tested this by rendering the original fonts through GDI+ (the same rasterizer used by GDI and DirectWrite) and reproduced the artifacts, then ran an overlap-removal pass and rendered again through the same path, after which they were gone.

Based on this, running "Remove Overlap" and "Correct Direction" on the glyphs, and optionally re-hinting, may resolve the issue. This can be done in FontForge (Element > Overlap > Remove Overlap, then Element > Correct Direction), or with fontTools and skia-pathops:

pip install fonttools skia-pathops
from fontTools.ttLib import TTFont
from fontTools.ttLib.removeOverlaps import removeOverlaps

for path in ("cff1.otf", "cff2.otf"):
    font = TTFont(path)
    removeOverlaps(font)
    font.save(path.replace(".otf", "_fixed.otf"))

It might be worth trying the cleaned fonts in your original HTML test and in the Windows font preview to see whether the artifacts are resolved on your end. If any glyphs still show issues, I would be happy to take another look if you can share the updated files. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation.

Thank you.

Was this answer helpful?

1 person found this answer helpful.

1 additional answer

Sort by: Newest
  1. Taki Ly (WICLOUD CORPORATION) 4,440 Reputation points Microsoft External Staff Moderator
    2026-08-17T04:27:33.5366667+00:00

    Hi @Roger Khoueiri ,

    I'm working on this issue and will try to get back to you soon. Thank you for your patience.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.