by scott_s · 16y ago · 0 comments
Yes: see (for example) http://en.wikipedia.org/wiki/Hz-program .
A really good H&J algorithm is doing a significant amount of work. It has to think about things like successive hyphens (which get distracting quickly), rivers (the unpleasant vertical lines of whitespace that appear especially in over-spaced text), and so on. This involves lots of backtracking and image processing, and it fires every time the layout changes. It’s all possible to do in a browser someday, but it’s not trivial.
FTFY
Seriously though, browsers need better typography in general. http://nitens.org/taraborelli/latex
It wouldn’t be strange to have a CSS property that controls hyphenation, ‘text-overlow:ellipsis’ (which adds a ellipsis before the text overflows [+]) also changes the text at that level.
True hyphenation requires:
0. A property to enable or disable hyphenation 1. Hyphenation algorithm (mostly a solved problem) 2. Hyphenation dictionaries: One per language, and need to be high quality -- OpenOffice has the best open source one, but generally these are not very common
I'm not convinced that 0 or 1 are the blockers here.
There could be another issue: speed. Doing proper hyphenation and justification slows layout.