4 ms·
This is great news. However, having a Knuth & Plass line breaking algorithm without hyphenation is like sex without a partner. Pretty much useless. The good poi
by patrickg 17y ago
This is great news. However, having a Knuth & Plass line breaking algorithm without hyphenation is like sex without a partner. Pretty much useless. The good points you get from using a total fit algorithm is much less then you lose from lack of hyphenation. If hyphenation is implemented, this will be very great!
- mbrubeck 17y agoNow that Firefox 2.0 is history, you can reliably use soft hyphens to hyphenate HTML text, and there are JavaScript libraries to do the hyphenation on the client: http://www.mnn.ch/hyph/hyphenation1.html http://www.mnn.ch/hyph/hyphenation1.html
- jacobolus 17y agoWell, hyphenation isn’t too hard, since there are reasonable solutions that can be used directly or easily ported. (There are existing javascript hyphenation libraries floating around.) The real problem with all of this is that everything is being done in a canvas element, which means no text selection, no searching, etc. etc.
- bramstein 17y agoHyphenation is definitively on my to-do list. As you said, it will improve the output of the canvas tremendously. The canvas is just a way to show the output of the line breaking algorithm. Earlier I had an example on my website of a dynamically created DOM paragraph using the Knuth & Plass algorithm. That way, the rendering was done by your browser (i.e. select, searching, etc. was possible) while the line breaks were handled by the algorithm. Unfortunately I haven't been able to get it reliable on all browsers, so I took it out before I posted this item. It's still on my Github repository: http://github.com/bramstein/javascript/tree/master/src/typeset/ http://github.com/bramstein/javascript/tree/master/src/types...
- elblanco 17y agoI'm definitely following this and waiting for when you get the browser rendering complete. The could be really great.