How to Check Glyph Path Winding Order in FontForge
Glyph path winding direction determines which areas of a font character are treated as solid shapes and which are treated as hollow cutouts. In FontForge, incorrect path orientation can cause glyphs to render inverted or create fill errors when compiling TrueType (TTF) or PostScript/OpenType (OTF) formats. This guide outlines how to visually inspect path directions, use FontForge’s automated verification tools to locate winding errors, and automatically fix contour directions across your entire font.
Understanding Font Winding Rules
Different font formats rely on specific contour directions:
- TrueType (TTF): Outer paths must run clockwise; inner cutouts (counters) must run counter-clockwise.
- PostScript / OpenType (OTF): Outer paths must run counter-clockwise; inner cutouts must run clockwise.
If an outer contour and an inner cutout have the same direction, rendering engines may fill the cutout or drop the entire shape.
Method 1: Visual Inspection in the Glyph Window
You can inspect the exact vector direction directly in the drawing view:
- Double-click any glyph in the font matrix to open the Glyph Edit Window.
- Go to the top menu and select View > Show.
- Ensure Points is checked. FontForge displays small directional arrows on the contour lines alongside the on-curve points.
- Follow the arrows around each contour:
- Verify that the outer boundary points in the required direction.
- Verify that any enclosed counter-spaces (such as the hole inside an "O" or "P") flow in the opposite direction.
Method 2: Use the "Find Problems" Tool
To test the entire font for winding and direction errors automatically:
- Open your font project and select the glyphs you want to audit (or press Ctrl+A / Cmd+A to select all).
- Go to Element > Validation > Find Problems (or press **Ctrl+Shift+_**).
- In the dialog box, navigate to the Paths tab.
- Check the box for Check direction.
- Click OK.
FontForge will scan your glyphs and display an alert dialog for any glyph where the outer and inner paths fail standard orientation rules, allowing you to review each issue individually.
Method 3: Automatically Correct Path Direction
Rather than manual verification, FontForge can calculate and apply the standard winding order across your glyphs automatically:
- Select your target glyphs in the main font view or select all contours in the Glyph Edit Window.
- Go to Element > Correct Direction (Shortcut: Ctrl+Shift+D on Windows/Linux, Cmd+Shift+D on macOS).
FontForge calculates the hierarchy of nested paths, forces outer paths to match the target font specification, and reverses inner cutouts so they display as transparent holes.
Reversing Direction Manually
If an individual path needs to be flipped manually after an inspection:
- Open the glyph in the Glyph Edit Window.
- Select a point on the specific path you wish to reverse.
- Choose Element > Reverse Direction. The arrows on that contour will flip immediately.