I want better justification (text‑align)

Submitted by Johannes Ammon

Community Pick

The quality of justified text in the web browser is way behind the quality of justified text set in professional desktop publishing software. There are several reasons for this. Some are systematic (manual line-breaking is impossible in a fluid and responsive environment), some are technical limitations:

  1. hyphenation has been a problem for a very long time;
  2. there is currently no implementation of advanced line breaking algorithms like the knuth-plass-algorithm in any of the browsers. (Why is that?)

In my master thesis, I explored ways to improve justified text on the web. I achieved significant improvement by applying a javascript-implementation of the knuth-plass-algorithm (by Bram Stein) and by implementing additional parameters such as variable fonts and opentype ligatures. Unfortunately, there is no possibility to hook into the default line breaking algorithm of the browser. This is something I would like so see in the future, for the sake of better typography on the web.

CSS Typography
This was presented at