Skip to content

Main content

Glyph Sidebearing Optical Center Offset Tool

Bounding-box ink-center offset from advance center, not a perceptual optical-center estimate.

Loading tool…

Description

Return inkWidth, leftBearing+inkWidth/2, advance/2, and (leftBearing-rightBearing)/2 as centerOffset.

Typography combines several distinct scales: font size describes an em scale, cap height describes a font metric, leading describes baseline spacing, and variable-font axes select design coordinates. Ratios between them require an explicit convention.

Return inkWidth, leftBearing+inkWidth/2, advance/2, and (leftBearing-rightBearing)/2 as centerOffset.

When to use this tool

Use Glyph Sidebearing Optical Center Offset when you need to compare supplied type metrics or font-axis values on a consistent basis.

How to use the tool and how it works

  1. Enter advance, leftBearing, rightBearing. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read inkWidth, geometricInkCenter, advanceCenter, centerOffset. Use the output convention below.

Require nonnegative advance and nonnegative advance-leftBearing-rightBearing. Return inkWidth, leftBearing+inkWidth/2, advance/2, and (leftBearing-rightBearing)/2 as centerOffset.1

Input fieldMeaning and unitsAccepted input
advanceAdvanceRequired. Finite number; minimum 0.
leftBearingLeft BearingRequired. Finite number.
rightBearingRight BearingRequired. Finite number.
Output fieldInterpretationReturned shape
inkWidthInk WidthRequired. Finite number.
geometricInkCenterGeometric Ink CenterRequired. Finite number.
advanceCenterAdvance CenterRequired. Finite number.
centerOffsetCenter OffsetRequired. Finite number.
json
{
  "input": {
    "advance": 20,
    "leftBearing": 2,
    "rightBearing": 4
  },
  "output": {
    "inkWidth": 14,
    "geometricInkCenter": 9,
    "advanceCenter": 10,
    "centerOffset": -1
  }
}

Limitations and assumptions

  • Bearings may be signed; the center is a one-dimensional bounding-box midpoint rather than a measured optical center or glyph-shape centroid.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Read actual font metrics and variation tables when available, then proof the text in its intended renderer. A metric calculation cannot replace shaping, glyph inspection, or an actual layout test.

References

  1. Calculation and input contract: graphic-design/glyph-sidebearing-optical-center-offset — tool.io

Similar or alternative tools