Live data from Hacker News

Balancing text for better readability

blogs.adobe.com

41–50 of 92 posts

Re: Balancing text for better readability

#41
post #5

Why not just use the Knuth-Plass algorithm as implemented in http://www.bramstein.com/projects/typeset/ ?

I'm really excited about this. While it is not the Knuth and Plass algorithm, it takes one of the nice features of it and proposes a simple algorithm to implement it. Implementing it should only be a minor adjustment to the text layout algorithms of browser rendering engines, and if implemented correctly it should not cause any reflows, only a repaint.

Re: Balancing text for better readability

#42
post #40
post #2

I 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?

I use Opera: it can switch off all styles, leaving only defaults. It does wonders with a lot of "only the author loves that formatting" pages.

Re: Balancing text for better readability

#43
post #40
post #2

I 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?

The trends to make thin grey text on nearly-gray background are driving me nuts also. I have two global Stylish [0] styles in my Firefox and I toggle them when I need to read something on a page like this:

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.

[0] https://addons.mozilla.org/en-US/firefox/addon/stylish/

Re: Balancing text for better readability

#44
post #28

Earlier 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.

I'm not totally sure, but I think the linear time papers I've read sacrifice some of the aspects of the original Knuth and Plass algorithm. I think some of those are going to be necessary to properly implement the Knuth and Plass algorithm in browser (also, floats are going to be interesting.)

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

#45
post #16

Earlier 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.

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

#47
post #40
post #2

I 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?

Not a bookmarklet, but I highly recommend http://evernote.com/clearly/ for the general case of this problem.

Re: Balancing text for better readability

#48
post #16

Earlier 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.

Awesome, thanks! I foolishly forgot to see if there were siblings to my post. (I try and keep a handle on discussions I'm in with the "threads" link.) So, yeah, apologies for missing those posts.

Re: Balancing text for better readability

#49
post #15
post #2

I 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.

Why then, people insist in using those light fonts? Yes, it looks "clean" and "modern" but they are too hard to read!

Re: Balancing text for better readability

#50
post #4

Wouldn'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

That seems even worse because it's slaughtering the wrapability of the text. That would only work on a container of pre-set size, and maybe then only on certain clients. How do you know which font client x will load?
Post reply on HN