top | item 32348238

(no title)

chucky | 3 years ago

I once discussed this with a coworker who had worked a lot on various things related to typesetting, and he claimed the main issue with doing good text justification for the web is the lack of good, free hyphenation dictionaries (or rules) for most languages. In order to do full paragraph justification in a way that makes sense and always looks good you need to be able to hyphenate words dynamically (and fairly aggressively).

LaTeX does come with hyphenation libraries for some languages, but web browsers would need wider support. There's also the question of how to standardize this, because you would have to ship hyphenation dictionaries for every language, and you would need to standardize this across browsers so they render pages the same.

LaTeX does ship with hyphenation libraries for a bunch of languages, but if you try to use it for any of the minor languages, you'll find the results are so-so and you need to manually hyphenate words to get decent results (this was my experience a decade ago at least).

All of the above could be solved, but sadly I suspect it wouldn't be worth the cost for the players that would have to be involved in solving it.

discuss

order

thristian|3 years ago

Firefox does indeed come with hyphenation dictionaries for a bunch of languages, in order to support the CSS `hyphens` property:

https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens

If you look at the language support tables at the bottom of the page, though, other browsers don't support nearly as many languages.

bombcar|3 years ago

The biggest advantage LaTeX has is that the page width stays the same between various versions of your document, so you can improve it on the fly when you notice issues.

The web tries to support every possible page width so some won't look great.

ksherlock|3 years ago

I set up my static site generator to pre-process text and insert soft hyphens (& shy ; ). That was based on Ruby Text::Hyphen which uses TeX hyphenation patterns.