Description
Return signed outward shifts and subtract both weighted overhangs from glyphAdvance for effectiveWidth.
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 signed outward shifts and subtract both weighted overhangs from glyphAdvance for effectiveWidth.
When to use this tool
Use Optical Margin Supplied Glyph 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
- Enter glyphAdvance, leftOverhang, rightOverhang, marginFraction. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read leftShift, rightShift, effectiveWidth. Use the output convention below.
Require nonnegative advance and overhang values and marginFraction in [0, 1]. Return signed outward shifts and subtract both weighted overhangs from glyphAdvance for effectiveWidth.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| glyphAdvance | Glyph Advance | Required. Finite number; minimum 0. |
| leftOverhang | Left Overhang | Required. Finite number; minimum 0. |
| rightOverhang | Right Overhang | Required. Finite number; minimum 0. |
| marginFraction | Margin Fraction | Required. Finite number; minimum 0; maximum 1. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| leftShift | Left Shift | Required. Finite number. |
| rightShift | Right Shift | Required. Finite number. |
| effectiveWidth | Effective Width | Required. Finite number. |
{
"input": {
"glyphAdvance": 20,
"leftOverhang": 2,
"rightOverhang": 3,
"marginFraction": 0.5
},
"output": {
"leftShift": -1,
"rightShift": 1.5,
"effectiveWidth": 17.5
}
} Limitations and assumptions
- EffectiveWidth may be negative; overhangs are supplied and this arithmetic does not measure optical balance, shape, kerning, or actual glyph rendering.
- 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
Similar or alternative tools
- Glyph Sidebearing Optical Center Offset
Return inkWidth, leftBearing+inkWidth/2, advance/2, and (leftBearing-rightBearing)/2 as centerOffset.
- Letter Spacing Em Pixel Crosswalk
Multiply signed spacingEm by nonnegative fontPixels for spacingPixels.