Why not just use the Knuth-Plass algorithm as implemented in http://www.bramstein.com/projects/typeset/ ?
Balancing text for better readability
41–50 of 92 posts
Re: Balancing text for better readability
#42I think it's odd that a post about readability has grey text (#686868) on a white background. Next to the black screen grabs the text is very light.
font-weight is indeed the main problem, but regardless I hate this new trend of not making text black. What would a bookmarklet look like to set the body color to black?
Re: Balancing text for better readability
#43I think it's odd that a post about readability has grey text (#686868) on a white background. Next to the black screen grabs the text is very light.
font-weight is indeed the main problem, but regardless I hate this new trend of not making text black. What would a bookmarklet look like to set the body color to black?
1) Enable Georgia font instead of the author's favourite thin font:
html body, html div, html span, html p {font-family:Georgia !important;}
2) Make everything black (except links):
html * {color:black !important;} a {text-decoration:underline !important; color:#00a !important;}
Those are not perfect but they work for me in 95% of the cases. The first rule is a not a catch-all to not put Georgia in code/pre/textareas etc. `html` is necessary not to affect Firefox's (browser) styling.
Re: Balancing text for better readability
#44Earlier quoted context omitted.
Bram Stein works for Adobe :) We did look into it but it was not fast enough for the needs of browsers.
The run-time of that particular implementation of the Knuth-Plass algorithm is quadratic in paragraph length, which is too slow for web browsers (which might have to deal with very long paragraphs). However, the algorithm can be implemented to run in O(n) for large n, or O(n log n) with smaller fixed constants. Though you might have some issues with the line breaks made by the browser.
The performance isn't actually that bad, I can perform line breaking in JavaScript on some very large documents, with the only performance bottleneck being DOM node creation (which native implementations won't suffer from.) If necessary the linebreaking could also be done incrementally, with a first first-fit pass and then the Knuth and Plass algorithm.
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.
Re: Balancing text for better readability
#45Earlier quoted context omitted.
None of Knuth's extensive work on typography seems to be well respected among designers (I'd love to be proven wrong about that).
Not respected, or not known? Edit: I'm seriously asking here, if anyone knows.
My impression is that the users of those programs are unfamiliar with the algorithms used, so I think it is the latter.
Re: Balancing text for better readability
#46Re: Balancing text for better readability
#47I think it's odd that a post about readability has grey text (#686868) on a white background. Next to the black screen grabs the text is very light.
font-weight is indeed the main problem, but regardless I hate this new trend of not making text black. What would a bookmarklet look like to set the body color to black?
Re: Balancing text for better readability
#48Earlier quoted context omitted.
Not respected, or not known? Edit: I'm seriously asking here, if anyone knows.
As mentioned above, Knuth's algorithms are implemented in many professional typesetting and layout applications. I think the people implementing those applications have great respect for Knuth (and Plass.) My impression is that the users of those programs are unfamiliar with the algorithms used, so I think it is the latter.
Re: Balancing text for better readability
#49I think it's odd that a post about readability has grey text (#686868) on a white background. Next to the black screen grabs the text is very light.
The font is the issue, not so much the color. Light fonts as the bread font are just a bad idea. Not that it matters even a little bit in this case. It's an irrelevant diversion of the worst kind. It's ignorant and foolish, something for small minds.
Re: Balancing text for better readability
#50Wouldn't it be easier and give you more editing control to just put text in a element? Seems like it would be hard to algorithmically determine what will visually look good