How to Fix Self-Intersections in FontForge
Self-intersection errors occur in FontForge when a glyph's contour crosses over itself, leading to rendering glitches, rasterization failures, and validation warnings in font compilation. This guide explains how to identify, automatically repair, and manually resolve self-intersecting paths using FontForge's built-in vector cleanup tools and manual editing techniques.
Method 1: The Automated "Remove Overlap" Command
FontForge includes an automated boolean operation designed specifically to resolve overlapping and self-intersecting paths by recalculating contour boundaries.
- Double-click the problematic glyph to open it in the Glyph Editor window.
- Select all contours by pressing
Ctrl + A(orCmd + Aon macOS), or choose Edit > Select All. - Navigate to Element > Overlap > Remove
Overlap (or press
Ctrl + Shift + O). - FontForge will calculate the intersecting boundaries, remove the internal crossing segments, and place clean on-curve nodes at the exact intersection points.
Method 2: Fix Path Directions
Self-intersections are frequently compounded by mismatched contour directions (winding order), which dictates what part of the glyph is filled and what part is cut out.
- Select the entire glyph outline.
- Go to Element > Correct Direction (or press
Ctrl + Shift + D). - This sets outer contours clockwise and inner cutouts (counters) counter-clockwise (or vice versa, depending on whether you are targeting TrueType or PostScript output), preventing accidental self-inversions.
Method 3: Manual Repair for Complex Intersections
If automated tools fail or distort the glyph's curves, the intersection must be cleared manually.
Locate the Exact Intersection
- Go to Element > Validation > Find Problems.
- In the Paths tab, check the box for Self Intersecting and click OK.
- FontForge will highlight the exact coordinates where the paths cross.
Eliminate Micro-Loops and Kinks
- Zoom in closely: Tiny self-intersections often happen at sharp corners where control handles accidentally cross over the segment they control.
- Inspect Bézier Handles: Look for off-curve control points pulled backward across an on-curve point, creating a microscopic loop. Drag the handle outward to untangle the curve.
- Remove Redundant Nodes: If two points sit on top of
each other, select both and choose Point > Merge (or
press
Ctrl + M) to combine them into a single clean node.
Final Validation
After applying either automated or manual fixes, confirm the error is fully resolved:
- Select Element > Validation > Validate.
- Ensure the glyph passes without throwing a "Self-Intersecting Glyph" warning.
- Test-export the font to ensure standard OpenType/TrueType tables compile without geometry errors.