The Utility
typeset.ts
The web wasn't built for typographers. Browsers fill each line until the words run out: short words like “a” and “the” get stranded at line ends, thoughts snap mid-phrase, and without text-wrap: pretty (Firefox has none) a single word can be left alone on the last line.
Typeset chooses where the lines of a paragraph, heading or list item break, keeps links and styling exactly as authored, and checks every result after it renders. It sets horizontal, left-to-right Latin-script text, with line-end preferences for English, French, German and Spanish; anything it cannot improve safely keeps the browser’s own layout, and says why. It does not hyphenate or justify.
01 — The drop-in
One script tag. No configuration, no build step, no framework. It composes paragraphs, list items, and headings with the same engine that sets this site: beam-search line breaking with contour re-ranking, Tschichold spacing, hanging punctuation, smart quotes, and self-checks that fall back to browser rendering rather than ever make your text worse. Opt any element out with data-no-typeset.
<script src="https://typeset.us/go@4.4.0.js" integrity="sha384-OPixflfJwk7LTcwv7u1n3T6ratxF6EeTJXn3D/TnLw9bCV2qkIVogco3QFZj6l5D" crossorigin="anonymous" defer></script><script src="https://cdn.jsdelivr.net/npm/typeset.us@4.4.0/dist/auto.js" integrity="sha384-OPixflfJwk7LTcwv7u1n3T6ratxF6EeTJXn3D/TnLw9bCV2qkIVogco3QFZj6l5D" crossorigin="anonymous" defer></script>typeset.us hosting has no uptime guarantee. For a strict Content Security Policy, or to keep every request on your own domain, install from npm and serve the file yourself. The unpinned go.js and go@4.js follow each 4.x release and cannot carry an integrity hash, so use them only for local testing.
02 — The library
The same engine as a window.Typeset global, for when you want to decide what gets composed and when.
03 — The source
TypeScript, dependency-free at runtime. This is the V4 engine entry; its supporting modules and React adapter ship in the npm package. Installation, migration, and V3 archive.