How to Invert Contour Direction in FontForge

Inverting the direction of a path contour in FontForge is an essential step in digital font design to ensure proper rendering and cutout behavior. The winding direction of a path—whether clockwise or counter-clockwise—determines whether a shape is filled with black or cut out as transparent, such as the counters in letters like "O" or "B". This guide explains how to manually reverse the direction of a specific contour, how to automatically correct path directions across an entire glyph, and how to verify path orientation.

Manually Reversing a Single Contour

To manually flip the direction of an individual path within a glyph:

  1. Double-click the glyph you want to edit in the main Font View window to open the Outline Glyph Window.
  2. Select the contour you wish to invert. You can do this by clicking directly on the path, dragging a selection box around its points, or double-clicking any point on the contour to select the entire closed path.
  3. Go to the top menu bar and select Element.
  4. Click Reverse Direction.

The starting point and ending point of the contour will swap, effectively changing the path's orientation from clockwise to counter-clockwise, or vice versa.

Automatically Correcting Contour Directions

FontForge features an automated tool that determines the intended outer contours and inner cutouts, adjusting their directions according to font format standards (TrueType or PostScript).

  1. In the Glyph Window, select all contours by pressing Ctrl + A (or Cmd + A on macOS), or leave everything unselected to apply the change to the entire glyph.
  2. Navigate to Element in the top menu.
  3. Select Correct Direction (keyboard shortcut: Ctrl + Shift + D or Cmd + Shift + D).

FontForge will analyze the nesting of contours, ensuring outer paths run clockwise (for TrueType) or counter-clockwise (for PostScript/CFF), while inner cutouts are set to the opposite direction.

Batch Correcting Directions Across Multiple Glyphs

To apply correct contour winding to multiple glyphs at once:

  1. Return to the main Font View window.
  2. Select the desired glyphs by holding Shift or Ctrl / Cmd while clicking, or press Ctrl + A to select all glyphs in the font.
  3. Go to Element > Correct Direction.

Verifying Contour Direction

To verify that the inversion was successful:

  • Inspect Direction Arrows: In the Glyph Window, each selected point displays small directional indicators showing the path flow.
  • Enable Fill Preview: Go to View > Fill (or press the fill toggle) to preview the glyph as a solid rasterized shape. If an inner counter appears solid black instead of transparent, its contour direction matches the outer boundary and must be inverted.