Not properly typeset
purpleidea opened this issue ยท 9 comments
Great idea, I love it! However the most important feature of LaTeX is proper typesetting, IOW, variable spaces, etc... Any way this can be implemented? I'm not sure how HTML would really support this. Perhaps that is an upstream browser issue that someone can fix first?
Cheers!
I agree, but I doubt there is a way to properly typeset HTML. Hyphenation is a mess and having text-align: justify;
doesn't really help. Check out this comment from yesterday's HN thread.
The line-height, font-size and letter-spacing can probably be tweaked, but other than that there is not much that can be done using CSS only in terms of typesetting. Hopefully, the situation improves in the near future.
Yeah, I always hated reading on screens for exactly this purpose. Maybe it's time for HTML to grow up and grow proper type setting? Maybe you can use this issue to track links to upstream issue trackers? Maybe open an issue with w3c, firefox, chrome, and whatever M$ is doing these days?
Thanks for the nice idea, hopefully you can properly fix ugly text everywhere!
Actually I don't think that's true anymore. Firefox apparently uses the same algorithm as TeX, see here:
So for the same font and geometry, the results should be the same.
The Hyphenopoly library could be used as a polyfill for the rare cases that don't support it, but with up-to-date browsers it's becoming less and less relevant.
@jotaf98 Hyphenation is only one aspect of typesetting. Open a LaTeX document and look put calipers up to your screen and measure the difference between the size of the space between two words, and the size of the space between two sentences. And there's much more...
That's true -- it's a start, not a full solution.
Building on Hypohenopoly's example, which iterates the words and adds hyphens at strategic places, could it theoretically be possible to iterate the words and wrap them in <span>
tags with custom left/right margins and letter-spacing, following TeX's spacing algorithm?
The CSS font ligatures handle quite a bit of odd inter-letter spacing. I wonder if the level of granularity of per-word letter-spacing plus inter-word margins would be enough to achieve an almost indistinguishable effect!
Nice project guys,
I have had this link in my bookmarks for quite some time: https://github.com/bramstein/typeset
Would that help with the typesetting?
Good find! @purpleidea and @vincentdoerig does this seem to address the issues you mentioned before?
@jotaf98 I don't have time to look into it, but I hope the state of the art gets better!
Thanks for the link @nvictor! The project looks very interesting. Unfortunately, I'm currently also busy and don't have time to explore it further. But it's definitely something I'd like to look at in the future ๐.