
Line Breaking (2014) - netgusto
http://xxyxyz.org/line-breaking/#
======
microtherion
My favorite discussion of this is in TeX: The Program, starting at §813 on
page 302: [http://brokestream.com/tex.pdf](http://brokestream.com/tex.pdf)
(I'm not sure if the discussion can be followed by jumping in in the middle; I
read the book cover to cover at one point).

------
amelius
While theoretically very interesting, this seems to be pretty much a non-
problem given today's computing power, combined with the fact that paragraphs
are usually not very long, and the fact that imperfections are not actually
disastrous.

~~~
userbinator
...in the same way that bubblesort is a "non-problem" with small sizes?

The problem is that in the real world, especially with untrusted arbitrary
input, you _can_ easily cause these algorithms to take maximum time. Combine
that with the typical (in)efficiency of HLLs and it's a potential for DoS. See
the exponential backtracking behaviour of some regex engines for a related
example.

~~~
idiocyreigns
It will always be important to sanitize and validate your input.

~~~
wongarsu
Sure, but that doesn't mean we need to introduce more classes of problems we
have to check against. Designing algorithms to handle all cases efficiently is
often better than trying to filter everything that triggers cases the lazy
algorithms can't handle

------
kccqzy
Add hyphenation, protrusion, and character expansion to the mix and I'm
interested in seeing how these can be handled.

~~~
bradbeattie
The problem might be made notably more difficult when accounting for non-
monospaced fonts and rivers:
[https://en.m.wikipedia.org/wiki/River_(typography)](https://en.m.wikipedia.org/wiki/River_\(typography\))

~~~
wnoise
Penalizing rivers would complicate things, but non-monospaced fonts are
handled with only small modification.

------
zypeh
I like the graphs and the design!

------
m8rl
Thank you Juraj for this work and the also very promising flat and even
projects!

------
abakus
It is almost a non problem for Chinese text: words are mono spaced squares.

