Javascript implementation of Knuth's Justification Algorithm