Fix Self-Intersecting Contours in FontForge

Self-intersecting contour errors in FontForge occur when a glyph's outline crosses over itself, creating rendering glitches and validation failures in modern font engines. This guide provides quick, actionable methods to resolve these errors using FontForge's automated repair tools, geometry cleanup operations, and manual node adjustments.


Understanding the Error

A self-intersecting contour means a single path loops back across its own segment, or two overlapping paths exist on the same layer without being properly merged into a single boundary. Font validation tools flag these because rasterizers cannot reliably determine which side of the intersecting path is the inside or outside of the shape.


Method 1: Use the "Remove Overlap" Command

FontForge includes an automated boolean tool designed specifically to merge overlapping paths into clean, unified outlines.

  1. Double-click the affected glyph in the Font View to open the Glyph Edit Window.
  2. Select all contours by pressing Ctrl + A (or Cmd + A on macOS).
  3. Navigate to Element in the top menu.
  4. Select Overlap > Remove Overlap (Shortcut: Ctrl + Shift + O or Cmd + Shift + O).
  5. FontForge will calculate the intersection points, slice the overlapping geometry, and combine the shapes into a single non-intersecting outline.

Method 2: Correct Path Directions

Incorrect path directions (clockwise versus counterclockwise) frequently cause false or compound self-intersection warnings.

  1. In the Glyph Edit Window, select all contours (Ctrl + A / Cmd + A).
  2. Go to Element > Correct Direction (Shortcut: Ctrl + Shift + D or Cmd + Shift + D).
  3. This ensures exterior contours run clockwise and interior cutouts (counters) run counterclockwise, matching TrueType and PostScript specifications.

Method 3: Simplify the Path

Sometimes an intersection is caused by micro-loops created by adjacent or duplicate points.

  1. Select the affected area or the entire glyph.
  2. Go to Element > Simplify > Simplify (Shortcut: Ctrl + M or Cmd + M).
  3. This command removes redundant nodes and cleans up erratic Bézier curve handles that may cross over each other at microscopic levels.

Method 4: Manual Node Repair

If automated tools distort the glyph or fail to clear the error, resolve the intersection manually:

  1. Identify the exact coordinates of the intersection by running Element > Validation > Find Problems, checking Self Intersection, and clicking OK.
  2. FontForge will place a marker or highlight the problem node.
  3. Zoom in closely on the marked area using the magnifying tool or + key.
  4. Look for:
    • Collinear handles: Control handles pulled backward through their own on-curve point. Retract or rotate the handle back to its proper side.
    • Overlapping nodes: Two points sitting at the exact same coordinate. Drag one away or delete the redundant point with the Delete key.
    • Figure-8 loops: If a path crosses itself like an "8", cut the path using the Knife tool, delete the intersecting segments, and reconnect the open endpoints manually.

Verifying the Fix

After applying the changes, confirm the error is cleared:

  1. Go to Element > Validation > Validate.
  2. Ensure that "Self-intersecting glyph" no longer appears in the validation results.
  3. Save your font file (Ctrl + S / Cmd + S).