Fix Contour Direction Errors in FontForge

In digital typography, incorrect contour directions cause font rendering bugs, resulting in cutouts filling in or overlapping areas disappearing entirely. This guide explains how to identify contour direction issues, resolve overlapping paths, and apply FontForge's built-in direction correction tools to ensure glyphs render and export properly across all platforms.

Understanding Contour Direction

Font formats rely on path winding directions to determine which areas are solid shapes and which are transparent cutouts:

  • PostScript / OpenType (CFF): Outer contours must run clockwise; inner cutouts must run counter-clockwise.
  • TrueType: Outer contours run counter-clockwise; inner cutouts run clockwise.

When overlapping contours have conflicting directions, or when overlapping segments confuse the fill algorithm, the rasterizer fails to render the glyph correctly.

Step 1: Remove Overlaps

Before correcting path directions on intersecting shapes, you should merge overlapping paths into a single unified outline.

  1. Double-click the glyph to open it in the Glyph Edit Window.
  2. Select all contours by pressing Ctrl + A (Windows/Linux) or Cmd + A (macOS).
  3. Navigate to Element > Overlap > Remove Overlap (or press Ctrl + Shift + O).
  4. FontForge will calculate intersections, cut away hidden segments, and merge the overlapping shapes into clean outer paths.

Step 2: Apply Automatic Direction Correction

Once overlaps are merged, FontForge can automatically calculate the correct winding rule for all remaining contours based on your font type.

  1. With the glyph still open (or with multiple glyphs highlighted in the Font View window), select your paths.
  2. Go to Element > Correct Direction (or press Ctrl + Shift + D).
  3. FontForge analyzes the nested hierarchy of your contours and sets the appropriate clockwise or counter-clockwise orientation for outer boundaries and inner cutouts.

Step 3: Manually Reversing Path Direction

If an unusual shape or intentional self-intersection is still rendering incorrectly after running automated tools, reverse the direction manually:

  1. In the Glyph Edit Window, select the specific path causing the error.
  2. Check the path orientation by viewing the point numbers or arrow directions on the lines (enable these via View > Show > Direction Marks if not visible).
  3. Go to Element > Reverse Direction.
  4. Test the fill by pressing the Fill toggle or pressing Ctrl + = to preview the solid glyph.

Step 4: Validate Glyphs

To verify that all direction and intersection issues are resolved across your entire font:

  1. Return to the Font View and select all glyphs (Ctrl + A).
  2. Go to Element > Find Problems.
  3. Under the Paths tab, check Check flipped paths, Check self-intersections, and Check missing points at extrema.
  4. Click OK to scan for and resolve any remaining outline inconsistencies before final font generation.