agentleFS
jpoindexterjpoindexter/typography-skills/skills/type-foundations/SKILL.md

type-foundations

Skill2 starsChanged 4 months agoMITView on GitHub

Use when typographic vocabulary or first principles are needed — what an em actually is, font vs typeface, leading vs line-height, points vs pixels, how CSS units relate, what the em square means. Also use when someone is confidently using a term incorrectly, or when an explanation needs grounding before a decision is made.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    text-box-trim / text-box-edge: remove the half-leading so text can be aligned by cap-height or x-height rather than by line box — the …

    line 86
  2. Very specific:

    Check every line-height is unitless.

    line 107
  3. Very specific:

    Check type sizes are in rem (or clamp() containing a rem term).

    line 108
  4. Very specific:

    Check no vw-only type sizing.

    line 109
  5. Very specific:

    If ch is used for measure, confirm it was verified with the shipping font.

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Type foundations

The vocabulary and measurement system everything else depends on. Most typographic mistakes at the decision level trace back to a wrong model here.

1. When to invoke

  • A term needs defining before a decision can be made.
  • Someone conflates font/typeface, leading/line-height, or point/pixel.
  • Choosing CSS units for type.
  • Explaining a typographic decision to a developer or client.

Do not invoke when the decision is already scoped — go to the specific skill.

2. Required context

  • The medium — print units and screen units are related but not equivalent.
  • The audience's existing vocabulary, so you correct only what matters.

3. Invariant principles

Typeface vs. font. A typeface is the design (Helvetica). A font is a specific instance of it that you use (Helvetica Bold 12pt; a .woff2 file). Historically a font was one size of metal type. The distinction matters in licensing and in file inventories.

Glyph vs. character. A character is the abstract unit (the letter "a"); a glyph is a drawn form. One character may have many glyphs (small cap, oldstyle, alternate); one glyph may represent several characters (the fi ligature).

The em square is the design space. An em is not the width of "M" — it's the full body of the type, historically the metal block. Glyphs are drawn within it and may fill it generously or sparsely, which is why two typefaces at the same point size render at visibly different apparent sizes.

Point size measures the body, not the letters. Nothing in a font is guaranteed to be exactly the point size. This is why apparent size must be judged visually.

Leading vs. line-height. Leading is historically the extra metal strip added between lines. CSS line-height is the total line box — the font size plus the space distributed above and below. So font-size: 16px; line-height: 24px means 8px of added space, not 24px. Don't use the terms interchangeably when precision matters.

Half-leading. CSS splits the difference between line-height and font size equally above and below the text. This is why text sits with extra space above the cap-height and below the baseline — and why text-box-trim exists.

Legibility vs. readability. Legibility is glyph-level: can a reader tell characters apart at all — 1 l I, 0 O o, q p, d b. Readability is text-level: whether the whole passage is comfortable to get through, which legibility feeds but doesn't determine — tracking, leading, measure, and plain boring content all affect readability independent of the typeface. A legible face can still be unreadable if poorly set; the two questions get asked and fixed differently. (Stocks)

4. CSS units for type

UnitRelative toUse for
remRoot font sizeDefault for type sizes. Respects user preference, predictable
emThe element's own font sizeSpacing that must scale with local text (margins on a heading)
pxDevice pixel (CSS px)Borders, hairlines. Avoid for type sizes — historically blocked user text scaling and remains less preference-responsive
chWidth of the 0 glyphRough measure caps only — varies per font, so unreliable for layout (Rutter)
exThe font's x-heightRare; occasionally useful for optical alignment
%ParentCompounding; use with care
vw/vhViewportNever alone for type — ignores user zoom. Only inside clamp() with a rem term
unitlessFont size, at compute timeAlways for line-height — inherits proportionally

Why unitless line-height. A unitless value is inherited as a ratio and recomputed against each element's own font size. A px or em line-height is computed once and inherited as a fixed length, so a larger child gets a line box too small for it.

5. Context-dependent heuristics

  • Root font size is the user's setting. The common default is 16px, but users change it. Sizing in rem honours that; sizing in px doesn't.
  • Points for print, pixels/rem for screen. 1pt = 1/72in. CSS px is a reference pixel, not a hardware pixel — on high-DPI screens one CSS px covers several device pixels.
  • text-box-trim / text-box-edge remove the half-leading so text can be aligned by cap-height or x-height rather than by line box — the long-standing "why is there mystery space above my heading" fix. Chrome/Edge 133+, Safari 18.2+, not Firefox as of mid-2026; ~80% availability, not Baseline. Degrades silently to today's behavior, so it's safe progressive enhancement.

6. Failure patterns

PatternCauseFix
"Set leading to 24px"Leading/line-height conflatedState which; prefer unitless line-height
Child text has a cramped line boxline-height in px or emUnitless
User's larger text setting ignoredpx type sizesrem
Measure cap drifts when the font changesch treated as stablech varies per font; verify or use rem
Same pt size, different apparent sizePoint size measures the bodyCompare x-heights
Unexplained space above a headingHalf-leadingtext-box-trim, or negative margin as fallback
"Font" and "typeface" used interchangeably in a licence discussionTerms conflatedBe precise; licensing depends on it

7. Evaluation procedure

  1. Identify which term is actually meant, and restate it precisely.
  2. Check every line-height is unitless.
  3. Check type sizes are in rem (or clamp() containing a rem term).
  4. Check no vw-only type sizing.
  5. If ch is used for measure, confirm it was verified with the shipping font.
  6. Confirm the root font size isn't hardcoded in a way that defeats user preference.

8. Output format

Term clarified: <term> = <precise definition>
Units: sizes in <unit> · line-height <unitless?> · measure in <unit>
Issues: <list>
Implication: <what changes as a result>

9. Examples

Developer asks: "the designer said 16/24 — do I set line-height: 24px?"

The intent is a 1.5 ratio, so set line-height: 1.5 unitless, not 24px. Two reasons. First, a px line-height is inherited as a fixed length: a child at 32px would get a 24px line box, which is smaller than its own text. Second, unitless recomputes per element, so the ratio survives every size in the scale. Also worth naming: "16/24" is line-height, not leading — leading is the 8px added between lines, and the distinction matters if you're ever translating a print spec.

10. Counterexamples

  • ❌ "An em is the width of the capital M." — It's the full type body; the M connection is historical coincidence.
  • ❌ "Set line-height in px for precise control." — Breaks inheritance.
  • ❌ "Use px so text renders consistently." — Consistency at the cost of ignoring the user's text-size preference.
  • ❌ "ch is the character width, so 65ch is 65 characters." — ch is the 0 glyph's advance width and varies per font; the rendered count will differ.
  • ❌ "16px is the standard body size." — It's the common browser default, which the user may change, and apparent size varies by typeface.
  • ❌ "Leading and line-height are the same thing." — Related, offset by the font size, and the difference matters when translating print specs.
  • ❌ "It's legible, so it's readable." — Legibility is glyph-level distinction; readability also depends on tracking, leading, measure, and content. (Stocks)

11. Source citations

  • Lupton, Thinking with Type 3e — typeface vs. font; anatomy and alignment; typographic conventions and their history.
  • Rutter, Web Typography — em, rem, and ch as the primary tools for adaptive web type; the caution that ch "varies from font to font so it's not usually suitable for layout purposes"; "a pixel is not a pixel" and subpixel rendering.
  • Stocks, Universal Principles of Typography — the em square "at the heart of it all"; font metrics; characters vs. glyphs; legibility (glyph-level distinction, tested via 1lI/0Oo/qp/db) vs. readability (text-level, also driven by tracking, leading, measure, and content) as related but distinct questions.
  • Latin, Better Web Typography — anatomy vocabulary; practical unit use.
  • Hochuli, Detail in Typography — the line and linespacing as craft terms.
  • MDN — line-height, text-box-trim (Chrome/Edge 133+, Safari 18.2+, not Firefox as of mid-2026).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.