One script tag. Instant access to the same typographic rules used by book publishers and design studios.
<script src="https://typeset.us/go.js"></script>She worked in a studio on the edge of the city. It was small but it had good light and a view of the park. On clear days she could see all the way to the bridge. The tools of her trade filled every surface — ink, paper, type specimens, a loupe she kept on a chain. Everything in its place. She believed good work came from good order, and she was right about that.
She worked in a studio on the edge of the city. It was small but it had good light and a view of the park. On clear days she could see all the way to the bridge. The tools of her trade filled every surface — ink, paper, type specimens, a loupe she kept on a chain. Everything in its place. She believed good work came from good order, and she was right about that.
Binds the last two words of paragraphs together with non-breaking spaces, preventing single words from sitting alone on the final line.
Automatically binds articles and prepositions (a, an, the, in, on, at, to, by, of, or, is, it, as, if, vs) to the following word to prevent awkward line breaks.
Binds the first two words after sentence-ending punctuation to ensure sentences don't start with a single word on a new line.
Binds short words (1-3 characters) before punctuation to the previous word for better visual rhythm.
Applies CSS text-wrap: pretty to paragraphs for balanced line lengths, and text-wrap: balance to headings for optimal centering.
Enables hanging-punctuation: first last on paragraphs so quotation marks and punctuation optically align with text.
Activates ligatures, contextual alternates, and kerning (liga, calt, kern) for professional-grade letter spacing and connections.
Customize which elements get typeset. Default targets: p, li, blockquote, figcaption, h1-h6, td, th, dd, dt, label
<script src="https://typeset.us/go.js" data-typeset-selector=".article p, .content h2"></script>Disable specific rules. Options: orphans, short-words, sentence-start, sentence-end, text-wrap, hanging-punctuation, font-features
<script src="https://typeset.us/go.js" data-typeset-disable="orphans,short-words"></script>Skip typesetting for specific elements or sections
<div data-no-typeset>This content won't be typeset</div>Manually run typesetting on a specific element or the entire document
// Run on entire document
window.typeset.run();
// Run on specific element
const article = document.querySelector('.article');
window.typeset.run(article);Process a string of text and return it with typographic rules applied
const raw = "This is a sample text";
const processed = window.typeset.text(raw);
console.log(processed);Get the current version of go.js
console.log(window.typeset.version); // "1.0.0"