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:
- Double-click the glyph you want to edit in the main Font View window to open the Outline Glyph Window.
- 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.
- Go to the top menu bar and select Element.
- 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).
- In the Glyph Window, select all contours by pressing
Ctrl + A(orCmd + Aon macOS), or leave everything unselected to apply the change to the entire glyph. - Navigate to Element in the top menu.
- Select Correct Direction (keyboard shortcut:
Ctrl + Shift + DorCmd + 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:
- Return to the main Font View window.
- Select the desired glyphs by holding
ShiftorCtrl/Cmdwhile clicking, or pressCtrl + Ato select all glyphs in the font. - 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.