Last month, Flipboard published some details about how their web and Windows 8 layout engines work. It is fascinating.
Duplo is a new layout engine that starts with the ideas in Pages but uses a modular block and grid system to quickly fit content into thousands of page layouts in all sizes. [...]
However, while Pages looks at about 20 candidate layouts, Duplo looks at anywhere between 2000 to 6000 candidates, searching for the best layout to fit the content.
This is the kind of attention to detail that Donald Knuth paid to typography with TeX back in the 70s. This is also the first time that I've seen an algorithmic approach to design out in the wild.