by seanwilson · 4y ago · 0 comments
Is there not a fast "good enough" algorithm for justifying text vs a slow optimal one? Is it really infeasible for HTML to have justified text that looks something like LaTeX? It's sad that justified text still looks bad on the web with no signs of it getting better even with all the computing power we have now.
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.
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.
The web tries to support every possible page width so some won't look great.
So, I don't know where the "too slow" meme is coming from. Is there a browser that can open and scroll to the end of an HTML page that's 500 screen-fulls long in 0.2 seconds?
Perhaps the parent commenter is executing `pdftex` on Windows. Like all Windows ports of UNIX/Linux-first software, LaTeX experiences the double whammy of the NT kernel being slow with small files + Windows Defender scanning. NTFS is not at fault, oddly enough: it works fast enough in Linux with the recent in-kernel NTFS3 driver.
I use the same distribution (MiKTeX) on both Windows and Linux, and Linux is easily 10× as fast as Windows when compiling complex files (TikZ graphs and diagrams, `.bib` files, internal hyperlinks, etc).
I suspect that another reason for a WYSIWYG office suite to not use such global optimisation, is to avoid unpredictable changes to layout in response to seemingly unrelated changes by the user. If you get full reflows with figures moving around and headings flipping between the previous and the next page while you're typing a sentence, users will probably quickly punch a hole in their monitor.
In (La)TeX this is less of an issue because of the delayed compilation, I guess. Also *TeX users are probably more tolerant to that kind of mess.