Better line breaks for web text. Typeset keeps short words like "a", "the" and "of" from being stranded at line ends, keeps names and numbers with their words, and avoids one-word last lines, in Chrome, Safari and Firefox alike. It leaves links, emphasis and React-rendered text exactly as authored, checks every result after rendering, and keeps the browser's layout whenever it cannot do better. The engine sets every page of typeset.us; the argument is at typeset.us/essay.
Use CSS first: text-wrap: balance for headlines, text-wrap: pretty for
paragraphs. Add Typeset for grammar-aware breaks, the same result in Firefox
(which has no pretty), preserved markup, and results your CI can check. It
does not hyphenate or justify.
The current release, pinned with its integrity hash:
<script src="https://typeset.us/go@4.4.0.js" integrity="sha384-OPixflfJwk7LTcwv7u1n3T6ratxF6EeTJXn3D/TnLw9bCV2qkIVogco3QFZj6l5D" crossorigin="anonymous" defer></script>npm i -E typeset.us@4.4.0Published pins are permanent: their bytes never change and they are never
removed. Every pin and its hash is in public/sri.json.
https://typeset.us/go.js also works for trying it out; it updates itself
within 4.x and will never move to 5.0. What a version number promises:
STABILITY.md.
The package README covers options, outcomes, React, costs and limits: packages/typeset-v4/README.md.
auditJSON(selector) reports errors, items to review, and what happened to
every element. A pass requires a nonempty scope with no hard errors or
unprocessed targets; it is not aesthetic certification. Every outcome is
explained in docs/outcomes.md. Full contract for agents:
typeset.us/for-agents. Read
support, including what is not yet tested,
and migration.
src/lib/v4/: the engine and React adapters.src/app/: the typeset.us website, which runs the same engine.packages/typeset-v4/: the npm packagetypeset.us.public/go@x.y.z.js,public/sri.jsonandpublic/releases/: published loaders, hashes and release archives, written only bynpm run release:cut.public/releases/published.json: the append-only ledger of every published file;npm run verify:ledgerfails if any of them changes.docs/: benchmarks, outcomes, releasing, security advisories.CHANGELOG.md: what changed, including the bugs.
npm run dev # site at localhost:3000
npm run build:dist # candidate build from src into output/candidate/; never writes packages/ or public/
npm test # test:v4: builds the candidate, then runs every suite against it (--only, --list)
npm run test:release # the same suites against the committed packages/typeset-v4/dist
npm run bench # benchmark: mount, typesetAll, React, storms, fonts, sizes (docs/BENCHMARKS.md)
npm run release:cut -- --version x.y.z --summary "…" # the only step that writes a release (try --dry-run)How to contribute, and how to report a bad line break: CONTRIBUTING.md. Releases: docs/RELEASING.md. Security: SECURITY.md.
MIT © Dustin York. The line-break data is Unicode, Inc. (Unicode-3.0).