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:

  1. Open your font project in the main Font View window.
  2. Select the glyphs you want to modify. Press Ctrl + A (or Cmd + A on macOS) to select all glyphs, or hold Shift to select a specific range.
  3. Navigate to the top menu and select Metrics > Set LBearing....
  4. In the dialog box, choose Set bearing to: and enter your desired value in font units (for example, 50). Click OK.
  5. With the glyphs still selected, return to the menu and select Metrics > Set RBearing....
  6. 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:

  1. Select your target glyphs in Font View.
  2. Go to Metrics > Auto Width....
  3. Enter the desired spacing unit or target character width in the dialog box.
  4. 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:

  1. Select a sequence of representative characters (such as H, O, n, o) in Font View.
  2. Choose Metrics > New Metrics Window (or press Ctrl + K / Cmd + K).
  3. Locate the metric rows at the bottom of the window labeled LBearing, Width, and RBearing.
  4. 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 = 50

Replace 50 with your desired font unit values to instantly standardize your font's metrics.