Hacker News new | past | comments | ask | show | jobs | submit login

Well, 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.




Hyphenation 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/types...


I'm definitely following this and waiting for when you get the browser rendering complete. The could be really great.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: