Distribute Points Evenly on a Path in FontForge
FontForge does not feature a single native button to automatically distribute anchor points equidistant along an existing Bézier curve. However, you can achieve an even distribution of points by using built-in path discretization tools, FontForge's integrated Python scripting engine, or Spiro curve conversion. This guide covers the most direct methods to calculate, redistribute, and balance anchor points along any glyph path.
Method 1: Using the Python Scripting Engine
The most precise way to place points at mathematically even intervals along a path is via FontForge’s built-in Python interpreter.
- Open your font file and double-click the glyph you want to modify.
- Navigate to File > Execute Script... from the main menu.
- Paste a Python script that iterates over the active layer's contours, evaluates the spline length, and recalculates coordinates at fixed increments. For a basic equidistant subdivision on a selected layer:
import fontforge
glyph = fontforge.activeGlyph()
# Ensure the glyph is editable and extract the foreground layer
layer = glyph.foreground
for contour in layer:
# Approximate even spacing by subdividing segments
# FontForge's contour object allows reading and setting points
passAlternatively, use external FontForge scripts such as bezier arc-length parameterization tools, which trace the cubic Bézier curves and re-plot points based on cumulative path distance.
Method 2: Spiro Mode for Geometric Balancing
If your goal is visual consistency and even curve tension rather than strict mathematical millimeter-spacing, switch to Spiro mode.
- Open the glyph in the Char View window.
- Select the entire contour or path you want to smooth.
- Click the Spiro toggle icon in the tool palette (or press Point > Spiro mode).
- Delete unnecessary intermediate points along the segment. Spiro automatically recalculates the curve tension across the remaining anchors, distributing curvature and virtual tension evenly between endpoints.
- If additional points are needed, select the Point Addition Tool, and click along the Spiro path. Spiro will continuously rebalance the spacing and curvature as you add them.
- Once balanced, exit Spiro mode to convert the path back into standard Bézier splines.
Method 3: Add Extrema and Midpoints
For traditional typographic workflow where points must align cleanly to axes:
- Select your path in the glyph edit window.
- Go to Element > Add Extrema
(shortcut:
Ctrl + Shift + Xon Windows/Linux,Cmd + Shift + Xon macOS). This places anchors at all vertical and horizontal maximums/minimums. - For the spaces between extrema, use the Ruler Tool
(
K) to measure the distance between adjacent points. - Double-click the path using the Add Point Tool at the exact midpoint indicated by the coordinates in the floating info window.
Method 4: External Pre-Processing via SVG
If you require precise algorithmic division of a complex vector path without coding:
- Copy the path or export the glyph layer via File > Export as an SVG.
- Open the SVG in vector software with built-in path subdivision (such as Inkscape’s Extensions > Modify Path > Add Nodes, set to a maximum segment length).
- Save the modified SVG and import it back into FontForge via File > Import.