Typeset.us — a new era in web typography

Forty-five years after print solved it, the browser catches up. Knuth’s mathematics, Tschichold’s tolerances, Bringhurst’s quarter-em — running live on every paragraph of this page.

Every paragraph on this page is set live by the engine.

01 — The Proof

Your phone wraps text. A book sets it.

Same words, same space, both rendered by your browser right now. The first is your browser doing its best on its own. Watch the ends of its lines: little words like “a” and “the” left behind, thoughts snapped in half. The second is set the way a book would set it. Then squeeze the column.

274px

Every line ends where it should — by intention. This is Typeset, live.

Your browser: CSS text wrapping.

Drag the slider and count the short words your browser leaves hanging at line ends. The book carries them down to the next line.

The book isn’t a book. It’s your browser running Typeset — the one-line script at the bottom of this page. Every paragraph you’ve read here was set the same way.

For developers

Three ways in. All of them pinned.

Any site, one tag

<script src="https://typeset.us/go@4.4.0.js" integrity="sha384-OPixflfJwk7LTcwv7u1n3T6ratxF6EeTJXn3D/TnLw9bCV2qkIVogco3QFZj6l5D" crossorigin="anonymous" defer></script>

Version 4.4.0, with its integrity hash. The file never changes.

<script src="https://cdn.jsdelivr.net/npm/typeset.us@4.4.0/dist/auto.js" integrity="sha384-OPixflfJwk7LTcwv7u1n3T6ratxF6EeTJXn3D/TnLw9bCV2qkIVogco3QFZj6l5D" crossorigin="anonymous" defer></script>

The same file from npm via jsDelivr, with the same hash.

npm

npm i -E typeset.us@4.4.0
import { mount } from 'typeset.us';

mount(document, 'article p, article h2');

React 18.2+ and 19

import { TypesetRichText } from 'typeset.us/react';

<TypesetRichText lang="en">
  Read <a href="/notes">the notes</a> first.
</TypesetRichText>

Do I need it?

  • Balanced headlinesCSS text-wrap: balance
  • No one-word last lines in Chrome and SafariCSS text-wrap: pretty
  • No “a”, “the” or “of” stranded at line ends; names kept togetherTypeset
  • The same result in FirefoxTypeset
  • Links and styling kept exactly; results your CI can checkTypeset
  • Justified text with hyphenationNot Typeset: CSS hyphens: auto
  • Right-to-left or non-Latin scripts; line-end rules for languages other than English, French, German and SpanishCSS text-wrap: pretty

60.0 KB gzipped for the script tag. No dependencies, no network calls, no tracking. Every result is checked after it renders, and a paragraph Typeset cannot improve keeps your browser’s layout.

02 — The Tastemaker

Type is the tell.

03 — The Craft

What the engine does while you read.

01

Hanging punctuation

Opening quotes hang their full glyph into the margin; optical capitals pull left. The block aligns to the eye, not the em box.

02

Contour re-ranking

The compositor finishes holding two hundred candidate paragraphs and chooses the most musical rag — never merely the cheapest.

03

Tschichold spacing

Word-space tolerances measured from your font’s own natural space — Tschichold’s 80 to 133 percent, the envelope InDesign adopted — never assumed from a quarter-em.

04

Self-healing lines

Every composed line is re-measured after render. If the browser disagrees, the engine steps back rather than ship an overflow.

04 — Proof of taste, in one line

Set your own text this well.

<script src="https://typeset.us/go@4.4.0.js" integrity="sha384-OPixflfJwk7LTcwv7u1n3T6ratxF6EeTJXn3D/TnLw9bCV2qkIVogco3QFZj6l5D" crossorigin="anonymous" defer></script>

The same engine that set this page: beam-search composition, hanging punctuation, smart quotes, self-checks that fall back to the browser rather than ever make your text worse. 60.0 KB gzipped, no dependencies, generated from the source you can read.

Set live by its own engine. View source — it’s the same code.