WeasyPrint icon indicating copy to clipboard operation
WeasyPrint copied to clipboard

Implement text-wrap-style

Open ondras opened this issue 1 year ago • 3 comments

Hi, I am trying to understand WeasyPrint in more detail. As far as I know, there are two families of line-breaking algorithms: fast-and-ugly, typically implemented by web browsers, and expensive-but-nice (e.g. Knuth-Plass) that are used in more serious typography. What kind of line breaking algorithm is implemented in WeasyPrint, please?

ondras avatar Oct 03 '24 15:10 ondras

Hi!

What kind of line breaking algorithm is implemented in WeasyPrint, please?

We’re a browser, we implement the ugly one. :smile:

But happily for you, things will change, even in browsers: the new text-wrap-style provides new ways to break lines, including a pretty value that is not specified but is a great opportunity to implement something close to the Knuth-Plass algorithm.

Interested in turning this issue into a feature request like "Support text-wrap-style"? (Note that it may take a lot of work to implement.)

liZe avatar Oct 03 '24 21:10 liZe

Interested in turning this issue into a feature request like "Support text-wrap-style"? (Note that it may take a lot of work to implement.)

Yeah! Interested a lot -- because I am typesetting a book with WeasyPrint and the line-breaking algorithm is an important part. Unfortunately, I am afraid that this feature, due to its complexity, will not make it in time (the book needs to be published in 1-2 months).

Related to line breaking -- I just submitted https://github.com/Kozea/WeasyPrint/issues/2267

ondras avatar Oct 04 '24 13:10 ondras

Unfortunately, I am afraid that this feature, due to its complexity, will not make it in time (the book needs to be published in 1-2 months).

Probably not. It may be part of a bigger change, like #1840.

liZe avatar Oct 05 '24 07:10 liZe