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.