News for hackers. Stuff that matters.
Re:Laying Out a Print Book with CSS by Karellen on Tuesday March 21, 2023 @08:26AM (#35245243)
> The splitting algorithm in CSS is worse than the one in TeX, because it has to work in real time and because (good) splitting patterns are often missing.

Surely that's only the case for real-time renderers like web browsers.

If you're creating a layout engine for printed media that uses CSS as the way for authors/setters to specify style, couldn't it implement a better, slower splitting algorithm? Using an internal (or pluggable?) dictionary of hyphenations?

Re:Laying Out a Print Book with CSS by eat_veggies on Tuesday March 21, 2023 @09:15AM (#35245653)
You could probably write some JS to reimplement the better algorithm and insert the ­ hyphenation hints
Re:Laying Out a Print Book with CSS by winety on Tuesday March 21, 2023 @11:11AM (#35247342)
You could and that's basically what TeX does, just without the CSS. There are even typesetting systems similar to (La)TeX, that can take XML as input, see Context [1] or Sile [2]. They’re just a step away from using HTML + CSS. Why isn’t there such system? I do not know.

[1]: https://wiki.contextgarden.net/XML

[2]: https://sile-typesetter.org/