Recent submissions

Comment · 11 months ago
Would love to hear or read more about this if it is public.
Comment · 11 years ago
You can, but then you're limited to a single font format and you would not gain any benefits from the browsers' ability to download in parallel.

A lot of this will improve when HTTP/2 becomes more common (you can push resource to the browser and parallel downloads will become more efficient).

Comment · 11 years ago
Comment · 13 years ago
Comment · 13 years ago
Comment · 13 years ago
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.

Comment · 13 years ago
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.

Comment · 13 years ago
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.
Comment · 15 years ago
Comment · 15 years ago
Comment · 15 years ago
Thanks for the reference. I have also recently released my own JavaScript hyphenation engine:

https://github.com/bramstein/Hypher

It is quite small and fast, and mostly aimed at integration with other libraries, unlike Hyphenator.js (which comes with a partial DOM library.) An example integration can be seen in the Treesaver library (https://github.com/bramstein/treesaver/tree/hyphenation) where it is used to hyphenate magazine columns.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton