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.

  1. Double-click the problematic glyph to open it in the Glyph Editor window.
  2. Select all contours by pressing Ctrl + A (or Cmd + A on macOS), or choose Edit > Select All.
  3. Navigate to Element > Overlap > Remove Overlap (or press Ctrl + Shift + O).
  4. 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.

  1. Select the entire glyph outline.
  2. Go to Element > Correct Direction (or press Ctrl + Shift + D).
  3. 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

  1. Go to Element > Validation > Find Problems.
  2. In the Paths tab, check the box for Self Intersecting and click OK.
  3. 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:

  1. Select Element > Validation > Validate.
  2. Ensure the glyph passes without throwing a "Self-Intersecting Glyph" warning.
  3. Test-export the font to ensure standard OpenType/TrueType tables compile without geometry errors.