Typeset.js

A typographic pre-processor for your HTML which uses zero client-side JavaScript and gives you:

Get the code
on GitHub

Yjarni Sigurðardóttir spoke to NATO from Iceland yesterday: "Light of my life, fire of my florins -- my sin, my soul. The tip of the tongue taking a trip to 118° 19' 43.5"."

"She's faster than a 120' 4" whale." Piña co­ladas were widely consumed in Götterdämmerung from 1880–1912. For the low price of $20 / year from Ex­hi­bits A–E... Then the duplex came forward. "Thrice the tower, he mounted the round gunrest, 'awaking' HTML. He can print a fixed num­ber of dots in a square inch (for in­stance, 600 × 600)."

How to get it

npm install typeset

The code is also available on Github.

How to use it

var typeset = require('typeset');
var html = '<p>"Hello," said the fox.</p>';
var output = typeset(html);

Modify typeset.css (<1kb) to match the metrics of your font and include it on your page. Learn more about the options on Github.

Found a bug?

Please file an issue on Github. Feel free to contact me with any questions.

About

This project started as a collection of libraries used by Blot for typesetting blog posts. This would not be possible without the work of Bram Stein and Dr. Drang. This page is set in Charter by Matthew Carter and Fira Mono by Erik Spiekermann.