Skip to content

Main content

Type Capheight Lineheight Share Tool

Calculate type capheight lineheight share from explicit caller-supplied inputs.

Loading tool…

Description

Return cap/line share, ascender+descender occupiedHeight, and lineHeight minus that total.

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 cap/line share, ascender+descender occupiedHeight, and lineHeight minus that total.

When to use this tool

Use Type Capheight Lineheight Share 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 capHeight, lineHeight, ascenderHeight, descenderDepth. 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 capShare, occupiedHeight, remainingLeading. Use the output convention below.

Require nonnegative capHeight, ascenderHeight, and descenderDepth and positive lineHeight. Return cap/line share, ascender+descender occupiedHeight, and lineHeight minus that total.1

Input fieldMeaning and unitsAccepted input
capHeightCap HeightRequired. Finite number; minimum 0.
lineHeightLine HeightRequired. Finite number; strictly above 0.
ascenderHeightAscender HeightRequired. Finite number; minimum 0.
descenderDepthDescender DepthRequired. Finite number; minimum 0.
Output fieldInterpretationReturned shape
capShareCap ShareRequired. Finite number.
occupiedHeightOccupied HeightRequired. Finite number.
remainingLeadingRemaining LeadingRequired. Finite number.
json
{
  "input": {
    "capHeight": 7,
    "lineHeight": 12,
    "ascenderHeight": 9,
    "descenderDepth": 2
  },
  "output": {
    "capShare": 0.5833333333333334,
    "occupiedHeight": 11,
    "remainingLeading": 1
  }
}

Limitations and assumptions

  • Measurements share a unit; negative remainingLeading and capShare above one are retained without evaluating actual glyphs, clipping, readability, or font correctness.
  • 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/type-capheight-lineheight-share — tool.io

Similar or alternative tools