Typeset

An HTML pre-proces­sor for web ty­pog­ra­phy. Typeset pro­vides ty­po­graphic fea­tures used tra­di­tion­ally in fine print­ing which re­main un­avail­able to browser lay­out en­gines. Typeset’s pro­cess­ing brings the fol­low­ing to your web­pages:




Get the code on GitHub   →





How?

Typeset does not re­quire any client-side JavaScript and uses less than a kilo­byte of CSS. Processed HTML & CSS works in Internet Explorer 5 and with­out any CSS. Typeset can be used man­u­ally or as a plu­gin for grunt and gulp.

npm install typeset

Usage

var typeset = require('typeset');
var html = '<p>"Hello," said the world!</p>';

html = typeset(html);

Then tweak Typeset.css to match the met­rics of your font and in­clude it on your page.

Options

Typeset ac­cepts an op­tional sec­ond ar­gu­ment con­tain­ing con­fig­u­ra­tion:

CLI

npm install -g typeset

Compiles a file to std­out:

typeset-js input.html

Pass an out­put file as a sec­ond ar­gu­ment:

typeset-js input.html output.html

Use the --ignore op­tion to ig­nore spe­cific CSS se­lec­tors:

typeset-js input.html output.html --ignore ".skip"

About

This pro­ject started as a col­lec­tion of li­braries I gath­ered for Blot. Typeset still runs there in pro­duc­tion. This was made pos­si­ble by the work of Bram Stein and Dr. Drang. This page is set in the Plex fam­ily by Mike Abbink. Thanks to Matthew Butterick and Chris Coyier for their help and feed­back.

License

This soft­ware is ded­i­cated to the pub­lic do­main and li­censed un­der CC0.

After Before

Yjarni Sigurðardóttir spoke to the EFF 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).”