Built with Pretext by Maxwell Ingham      GitHub      Twitter

Justification Algorithms Compared

The same passage, three approaches. Narrow the column to reveal the differences.

364px
CSS / Greedy
Native browser justification
CSS and greedy line-breaking produce similar results — both fill each line left-to-right and break when the line overflows. The differences emerge with hyphenation and global optimization.
Pretext (Hyphenation)
Greedy with syllable-level hyphenation
Pretext (Knuth-Plass)
Optimal global line-breaking with syllable hyphenation