Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

text-typesetting

БесплатноБез исполняемых скриптовНе проверен

Use when setting or reviewing line-height, letter-spacing (tracking), and vertical-trim/leading-trim for a text style — computing the geometric relationship…

monikazapisekот monikazapisek1 048 установок в других каталогах

Об этом скилле

Text Typesetting

Purpose

Compute a coherent line-height and letter-spacing for a given font-size and text role, and correctly account for vertical-trim (CSS leading-trim / Figma leadingTrim) when it changes what "line-height" visually means.

When To Use

  • Setting up a new text style/token (body, heading, label, caption).
  • Reviewing an existing style where line-height or tracking look off.
  • Inspecting a selected Figma text layer and proposing corrected values.
  • Not for generating an entire scale of sizes at once, and not for spacing between elements (that's vertical rhythm, a different skill).

Inputs

  • font-size (px or rem).
  • font-family-category: sans-serif / serif / display / monospace (serifs generally need more line-height breathing room than sans at the same size).
  • text-role: body / heading / UI label / caption.
  • text-case: original (sentence/title case) or uppercase/small-caps — this is the primary driver of letter-spacing direction, see Workflow step 2.
  • x-height: the ratio of x-height to font size (xr; Times is 0.447, Verdana 0.545), measured or read from the font — it sets where line-height falls inside its range (Workflow step 1a). For tracking, high / low is enough (step 2b). Optional: without it the skill falls back to the family rule and says so.
  • font-weight: numeric (100–900) if known — scales the tracking magnitude from step 2/2b, see Workflow step 2c.
  • variable-font-axes: if the font is variable, the actual wght value and whether an opsz (optical size) axis exists and is bound to size — see Workflow step 2d.
  • If available: leadingTrim / vertical-trim state (see Figma Node Integration) — this changes the recommended line-height, not just its visual effect.

Outputs

  • line-height value (unitless ratio preferred for body text, so it scales with font-size).
  • letter-spacing value (in em, since tracking should scale with font-size, not be a fixed px).
  • CSS/token snippet, plus a one-line rationale per value.

Questions

This skill is an audit, not an interview. Work in this order: read what the file or the input already says, report, then ask.

  • Ask only when a value can't be read and the answer would change the result. One question at a time.
  • Don't ask for anything the request already states or the file shows — say what you took and where it came from.
  • If the question can't be answered, state the assumption and carry on. Never stall the report on it.
  • Always ask before writing to a file or a Figma node.

Questions this skill may need:

  • The text role (body / heading / label / caption), when the style name and the size don't make it clear.
  • In Figma, permission to measure x-height — it creates and removes a temporary layer (Workflow step 1a). Without it, use the labelled fallback.

Workflow

  1. Line-height range by role and size:
    • Body text: 1.2–1.45 (Butterick: 120–145% of the point size).
    • Headings: tighter, 1.1–1.3 — a working range of this skillset; no direct source was found for these exact endpoints.
    • UI labels / captions: 1.2–1.4 — a working range of this skillset; no direct source was found for these exact endpoints.

1a. Position inside the range comes from the typeface's x-height, computed, not picked. The x-height ratio is the height of a lowercase x divided by the font size (xr). A face with a large x-height fills more of the line, so its lines look closer together and need more room; a face with a small x-height carries its own air.

t  = clamp((xr − 0.447) / (0.545 − 0.447), 0, 1)
LH = LH_min + t × (LH_max − LH_min)

xr = 0.447 or lower lands on the bottom of the range, 0.545 or higher on the top. The two anchors are the reference faces the W3C uses to explain x-height: Times, 0.447, as a low aspect value and Verdana, 0.545, as a high one (CSS Fonts Module, font-size-adjust). The direction is Butterick's: fonts that run small need less line spacing, and vice versa. Round LH to two decimals. Show xr, the range and the result.

How to get xr:

  • Font file or CSS: sxHeight / unitsPerEm from the font's OS/2 table; in a browser, 1ex measured against 1em.
  • Figma: the Plugin API exposes no font metrics. Measure instead: create a temporary text node with the single character x in the font at 100px, flatten it to a vector (figma.flatten([node])), read its height, divide by 100, and remove the vector. This creates and deletes a layer, so ask before doing it. Checked values from this method: Inter 0.545, Roboto 0.528, IBM Plex Sans 0.516, Source Serif 4 0.452, EB Garamond 0.409.
  • Not measured: fall back to the family rule — sans-serif in the lower half of the range, serif in the upper half — use the middle of that half, and state that x-height was not measured. Never present a fallback value as computed.

1b. **Measure compen

Полный SKILL.md на ClawHub

Установить text-typesetting в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл text-typesetting?

Use when setting or reviewing line-height, letter-spacing (tracking), and vertical-trim/leading-trim for a text style — computing the geometric relationship between font size and these values for body text, headings, UI labels, or captions.

Как установить скилл text-typesetting?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл text-typesetting запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить text-typesetting с