Measure and leading
measure_leadingCheck line length and suggest leading. Pass fontSizePx and containerPx (the text column width in px). Optional: charsPerLine (use a counted value instead of the estimate), language (en, de, fr, es, it, pt, nl, ru, ja, zh, ko; sets the average character width), avgCharWidthEm (override, default 0.5). Returns the measure in characters, whether it is inside 45 to 75 (25 to 40 for CJK), a recommended line-height (about 1.4 at the short end rising to 1.6 at the long end, tighter for large type), paragraph spacing, and the container width that hits the range. The 45 to 75 range is Bringhurst's guidance (The Elements of Typographic Style) as cited in Smashing's Typography Best Practices; 1.4 to 1.6 line spacing is from UXPin's Principles of Visual Consistency. The leading curve is a convention. Width is an estimate from an average character, so it is a guide, not a measurement.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"fontSizePx": "<fontSizePx>",
"containerPx": "<containerPx>"
},
"name": "measure_leading"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | No | Two-letter language code (default en). | |
| fontSizePx | Yes | Font size in px. | |
| containerPx | Yes | Width of the text column in px. | |
| charsPerLine | No | Optional counted characters per line, used instead of the estimate. | |
| avgCharWidthEm | No | Optional average character width as a fraction of the font size (default 0.5). |