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.