4 ms·
Knuth-Plass is missing from all e-readers, but is built into the most popular software for typesetting books, InDesign. Adobe even created a streaming version
by copperx 5y ago
Knuth-Plass is missing from all e-readers, but is built into the most popular software for typesetting books, InDesign.
Adobe even created a streaming version of the algorithm. It's mind-boggling that e-readers don't implement it.
Hell, even Internet Explorer used Knuth-Plass to justify text.
- chrismorgan 5y ago> even Internet Explorer used Knuth-Plass to justify text I haven’t heard of this before, and I don’t believe it’s at all correct. Searching, I’m finding only https://elliotjaystocks.com/blog/justification-hyphenation/ https://elliotjaystocks.com/blog/justification-hyphenation/ to be relevant: “Internet Explorer, which seems to use the Knuth / Plass algorithm, or an approximation of it, enabled through the text-justify: newspaper CSS property.” `text-transform: newspaper` is nothing like Knuth-Plass: rather, it was what is currently spelled `text-transform: inter-character`, which is a terrible idea for English.
- gwern 5y ago> `text-transform: newspaper` is nothing like Knuth-Plass According to Bramstein, who seems to be the source for this claim, after he implemented K-P in browsers, he checked IE's 'newspaper' against his own implementation, and it delivered almost identical results: https://news.ycombinator.com/item?id=5189258 https://news.ycombinator.com/item?id=5189258 >> I could be mistaken, but I'm fairly certain Internet Explorer implements the Knuth and Plass algorithm when using `text-justify: newspaper`. Unfortunately, I can't check because it isn't open source. The output however is pretty much identical to what my JavaScript version generates, so I'm inclined to believe it is the Knuth and Plass algorithm.
- chrismorgan 5y agoAh hah, good to know; I didn’t find that comment in my search. Seems odd to me because the main screenshot I’ve seen <https://www.mediumwell.com/wp-content/uploads/newsprint-justify-example.gif https://www.mediumwell.com/wp-content/uploads/newsprint-just...> exhibits identical line-breaking to greedy, just with inter-character spacing being done. On reflection, the narrow width combined with lack of hyphenation does make that a rather pathological case where there’s not much for Knuth-Plass to work with, beyond perhaps lines 14–16. (I haven’t actually tried Knuth-Plass on it.) Well, even if it did activate Knuth-Plass, it also enabled inter-character spacing which is rather bad for English and a most curious combination. I’m almost tempted to get out a VM with old IE (I’m guessing it was removed by IE9, though I suppose I could check it on IE11 first which I do have ready access to) and compare it more.