Why FontForge Reports a Bounding Box Mismatch

A bounding box mismatch in FontForge occurs when the actual geometric dimensions of a font’s glyph contours do not align with the coordinate limits defined in the font's metadata tables. This validation warning indicates that one or more glyphs extend beyond or fall short of the declared font-wide bounding box (FontBBox), which can lead to visual clipping, incorrect line spacing, and rendering failures across different operating systems. This article explains the technical reasons behind this error and how to quickly resolve it within FontForge.

Understanding the Font Bounding Box

In digital typography, the bounding box (FontBBox) is the smallest rectangle that can enclose all the glyphs in a font file when placed on a shared origin. It is defined by four coordinate values: xMin, yMin, xMax, and yMax.

These values are written directly into critical font tables, such as the head table in OpenType/TrueType fonts or the FontBBox dictionary in PostScript/CFF fonts. Rendering engines rely on these cached metrics to allocate memory, determine baseline alignment, and set line-height buffers without needing to parse the vector outlines of every glyph in the font.

Common Causes of the Mismatch Error

FontForge triggers a bounding box mismatch warning during font validation or export due to several specific factors:

1. Manual Edits Without Recalculation

If you modify, scale, or shift glyph outlines so that points extend past the previous maximum boundaries, the actual vector geometry expands. If FontForge or the imported source file does not automatically recalculate the global metrics in the font parameters, the stored header values become stale.

2. Stray Points and Wild Bézier Handles

Often, the mismatch is caused by invisible drawing errors:

  • Stray or orphan nodes: Unconnected single control points sitting far outside the visible glyph area.
  • Overextended control handles: Off-curve control points (Bézier handles) extending far beyond the base character limits can expand the calculated curve boundaries beyond the designated bounding box.

3. Component Transformation in Composite Glyphs

Composite glyphs (such as accented letters formed from base characters and diacritics) rely on component references. If a component is translated, scaled, or flipped, the derived bounding box may not register properly in the parent glyph until metrics are refreshed.

4. Format Conversion and Coordinate Rounding

Converting fonts between formats—such as TrueType (quadratic curves with integer coordinates) and PostScript (cubic curves that sometimes permit non-integer coordinates)—can cause slight mathematical rounding shifts. If a contour is already flush against the font's boundary limits, minor rounding errors during conversion push it outside the recorded box.

How to Fix the Error in FontForge

Method 1: Automatically Recalculate Metrics

  1. Open your project in FontForge.
  2. Go to Element > Font Info.
  3. Navigate to the General tab.
  4. Check the bounding box parameters. In most cases, letting FontForge regenerate the font will update the head table automatically, provided that the option to recalculate maximums is enabled.

Method 2: Identify and Clean Rogue Glyphs

  1. Select all glyphs using Ctrl + A (or Cmd + A on macOS).
  2. Go to Element > Validation > Find Problems.
  3. In the dialog, check Points too far off-canvas and Check Bounding Box.
  4. Click OK to run the scan.
  5. Review the flagged glyphs to remove rogue off-curve handles, stray single points, or contours that extend significantly outside the standard design canvas.

Method 3: Correct Extreme Vectors

Open any flagged glyph in the Glyph Window, select Element > Add Extrema, and then run Element > Simplify. Adding extrema ensures that nodes exist at the absolute vertical and horizontal limits of curves, which prevents mathematical discrepancies during bounding box calculation upon export.