How to Check Zero Advance Width in FontForge
Checking whether a glyph has an advance width of zero in FontForge is essential when designing combining accents, non-spacing marks, or hidden control characters. This guide explains how to quickly identify zero-width glyphs using the graphical interface through the Outline window, the Metrics view, the Set Width dialog, and automatically across an entire font using FontForge's built-in Python scripting.
Method 1: Check via the Outline Editing Window
- Double-click the glyph in the main font view to open the Outline Editing window.
- Observe the vertical guidelines:
- The solid vertical line at the origin (\(x = 0\)) represents the left side bearing.
- The dashed vertical line represents the glyph's advance width.
- If the advance width is set to zero, the dashed line sits directly on top of the \(x = 0\) axis.
Method 2: Check via the Metrics Window
- In the main font view, select the glyph you want to inspect.
- Go to Metrics > Open Metrics
Window (or press
Ctrl+Kon Windows/Linux,Cmd+Kon macOS). - Look at the data table beneath the visual display:
- Find the row labeled Width.
- If the value reads
0, the glyph’s advance width is zero.
Method 3: Check via the Set Width Dialog
- Select one or more glyphs in the main font view.
- Go to Metrics > Set Width....
- The dialog box opens showing the current width value. If the glyph
has zero advance width, the input field displays
0. - Click Cancel to close the dialog without altering any values.
Method 4: Check Programmatically Using Python
To quickly scan individual glyphs or locate all zero-width glyphs across an entire font, use FontForge’s built-in Python console.
- Open File > Execute Script....
- Select the Python radio button.
- Paste the following script and click OK:
import fontforge
font = fontforge.activeFont()
for glyph in font.glyphs():
if glyph.width == 0:
print(f"Zero width: {glyph.glyphname} (U+{glyph.unicode:04X})")The script prints the name and Unicode point of every glyph in the active font that currently has an advance width of zero.