Description
Multiply signed spacingEm by nonnegative fontPixels for spacingPixels.
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.
Multiply signed spacingEm by nonnegative fontPixels for spacingPixels.
When to use this tool
Use Letter Spacing Em Pixel Crosswalk 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 spacingEm, fontPixels, characterCount, includeTrailing. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read spacingPixels, gaps, addedWidthPixels. Use the output convention below.
Multiply signed spacingEm by nonnegative fontPixels for spacingPixels. Count max(0, characterCount-1) gaps, or characterCount when includeTrailing, and multiply for addedWidthPixels.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| spacingEm | Spacing Em | Required. Finite number. |
| fontPixels | Font Pixels | Required. Finite number; minimum 0. |
| characterCount | Character Count | Required. Safe integer; minimum 0. |
| includeTrailing | Include Trailing | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| spacingPixels | Spacing Pixels | Required. Finite number. |
| gaps | Gaps | Required. Safe integer. |
| addedWidthPixels | Added Width Pixels | Required. Finite number. |
{
"input": {
"spacingEm": 0.05,
"fontPixels": 20,
"characterCount": 10,
"includeTrailing": false
},
"output": {
"spacingPixels": 1,
"gaps": 9,
"addedWidthPixels": 9
}
} Limitations and assumptions
- CharacterCount is supplied rather than Unicode or glyph analysis; shaping, kerning, ligatures, bidi layout, and renderer-specific tracking behavior are not modeled.
- 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
- Type Size Leading Ratio
Convert both to points and return reciprocal type-size/leading ratios.
- Glyph Sidebearing Optical Center Offset
Return inkWidth, leftBearing+inkWidth/2, advance/2, and (leftBearing-rightBearing)/2 as centerOffset.