Back to Gallery

Slabtype Algorithm

Algorithim that fits text in a box in an aesthetically pleasing way.

Year 2007

Image from Slabtype Algorithm

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.

The algorithm transforms arbitrary text input into a rectangular “slab” of text designed to fit in a specified rectangle.
Slabtype was originally designed for the interface of the interactive documentary Public Secrets.