Image from Slabtype Algorithm
Slabtype Algorithm
Chevron pointing down

Slabtype Algorithm

by Erik Loyer

Go to project

Originally developed for Public Secrets, the Slabtype algorithm takes arbitrary text and calculates how to split and size it such that it fits in an arbitrary rectangle in an aesthetically pleasing way. The algorithm was later adapted as a jQuery plugin, and then to Javascript/Canvas. A four-part blog series describes the algorithm in detail.


Image 1 from Slabtype Algorithm

Slabtype was originally designed for the interface of the interactive documentary Public Secrets.

Image 2 from Slabtype Algorithm

The algorithm transforms arbitrary text input…

Image 3 from Slabtype Algorithm

…into a rectangular “slab” of text designed to fit in a specified rectangle.

Chevron pointing right
Chevron pointing left