2 ms·
"Web browsers render justified text very poorly. They don’t have the necessary algorithms to properly set the spacing between words and even individual letters
by mcguire 8y ago
"Web browsers render justified text very poorly. They don’t have the necessary algorithms to properly set the spacing between words and even individual letters (which is what proper text editors do). That’s why justified texts come with patches of space between the words: rivers of white between the black of text. This makes it very hard to read so justifying text on the web should be avoided at all costs. Web browsers are getting better in supporting hyphenation, though. If you do use justified text, complement it with hyphenation. For now, I recommend not using justified alignment at all."
It's not like a good algorithm hasn't been around since the '70s.
- munificent 8y agoSure, but that algorithm is O(n^2) which is fine for an offline program that spends a minute turning a TeX file into a PDF, but not OK for a 90s web browser that needs to reflow text in milliseconds while the user is resizing the window or a script is changing the DOM.
- bbleciel 8y agoWhat's the algorithm you're referring to here? Just curious