Typeset.js

A ty­po­graphic pre-proces­sor 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 yes­ter­day: Light of my life, fire of my florins — my sin, my soul. The tip of the tongue tak­ing a trip to 118° 19′ 43.5″.”

She’s faster than a 120′ 4″ whale.” Piña co­ladas were widely con­sumed in Götterdämmerung from 1880–1912. For the low price of $20 / year from Ex­hi­bits A–E… Then the du­plex came for­ward. Thrice the tower, he mounted the round gun­rest, awaking’ HTML. He can print a fixed num­ber of dots in a square inch (for in­stance, 600 × 600).”

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 avail­able on Github.

How to use it

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

Modify type­set.css (<1kb) to match the met­rics of your font and in­clude it on your page. Learn more about the op­tions on Github.

Found a bug?

Please file an is­sue on Github. Feel free to con­tact me with any ques­tions.

About

This pro­ject started as a col­lec­tion of li­braries used by Blot for type­set­ting blog posts. This would not be pos­si­ble with­out the work of Bram Stein and Dr. Drang. This page is set in Charter by Matthew Carter and Fira Mono by Erik Spiekermann.