How to Set Default Sidebearings in FontForge
Setting consistent left and right sidebearings in FontForge is essential for establishing balanced horizontal spacing across your entire typeface. This guide walks through the exact steps to define, batch-apply, and automate left and right sidebearing values across your glyph set using FontForge's built-in metric tools.
Batch Setting Fixed Sidebearings
FontForge calculates sidebearings based on the distance between the glyph contours and the vertical advance boundaries. To apply uniform default sidebearing values to your glyphs:
- Open your font project in the main Font View window.
- Select the glyphs you want to modify. Press
Ctrl + A(orCmd + Aon macOS) to select all glyphs, or holdShiftto select a specific range. - Navigate to the top menu and select Metrics > Set LBearing....
- In the dialog box, choose Set bearing to: and enter
your desired value in font units (for example,
50). Click OK. - With the glyphs still selected, return to the menu and select Metrics > Set RBearing....
- Select Set bearing to:, input your desired right sidebearing value, and click OK.
You can also use Metrics > Set Both Bearings... to configure both the left and right measurements simultaneously within a single dialog.
Automating Sidebearings with Auto Width
If you want FontForge to dynamically calculate natural default sidebearings based on the optical shapes of your characters:
- Select your target glyphs in Font View.
- Go to Metrics > Auto Width....
- Enter the desired spacing unit or target character width in the dialog box.
- Click OK. FontForge will analyze the bounding boxes and automatically distribute proportional left and right sidebearings.
Adjusting Bearings Directly in the Metrics Window
For real-time visual adjustments to your default bearings:
- Select a sequence of representative characters (such as
H,O,n,o) in Font View. - Choose Metrics > New Metrics
Window (or press
Ctrl + K/Cmd + K). - Locate the metric rows at the bottom of the window labeled LBearing, Width, and RBearing.
- Double-click the numerical value in the LBearing or RBearing field for any glyph to manually enter a new unit value, or click and drag the vertical reference lines directly in the preview area.
Automating via Scripting
To permanently enforce default sidebearings across new or imported fonts, run a quick script via File > Execute Script...:
import fontforge
font = fontforge.activeFont()
for glyph in font.glyphs():
glyph.left_side_bearing = 50
glyph.right_side_bearing = 50Replace 50 with your desired font unit values to
instantly standardize your font's metrics.