Catalog/design-line-height

Design

Line-height recommendation API

Recommends a line-height (leading) for a font size and line length using the heuristic that ideal leading rises with measure and falls with size, clamped to a readable range. Answers 'What line-height should I use for 16px body text on a 66-character measure?', 'How many px of leading is that?'.

Price$0.04per request
MethodPOST
Route/v1/design/line-height
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
designtypographyline-heightleadingreadabilitycssvertical-spacingbody-text
API URLhttps://x402.hexl.dev/v1/design/line-height
Integration docs
Example request
{
  "fontSizePx": 16,
  "charactersPerLine": 66
}
Example response
{
  "fontSizePx": 16,
  "lineLengthPx": 528,
  "recommendedLineHeight": 1.506,
  "recommendedLeadingPx": 24.09,
  "cssLineHeight": 1.506,
  "rangeChecked": [
    1.2,
    1.9
  ],
  "interpretation": "Comfortable body-text leading."
}
Input schema
{
  "type": "object",
  "required": [
    "fontSizePx"
  ],
  "properties": {
    "fontSizePx": {
      "type": "number",
      "description": "Font size in px",
      "examples": [
        16
      ]
    },
    "lineLengthPx": {
      "type": "number",
      "description": "Measure in px (or provide charactersPerLine)",
      "examples": [
        528
      ]
    },
    "charactersPerLine": {
      "type": "number",
      "description": "Characters per line; derives measure if lineLengthPx omitted",
      "examples": [
        66
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}