Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarification: line breaking algorithm #2264

Open
ondras opened this issue Oct 3, 2024 · 3 comments
Open

clarification: line breaking algorithm #2264

ondras opened this issue Oct 3, 2024 · 3 comments
Labels
CSS Questions about how to do something with CSS

Comments

@ondras
Copy link

ondras commented Oct 3, 2024

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?

@liZe liZe added the CSS Questions about how to do something with CSS label Oct 3, 2024
@liZe
Copy link
Member

liZe commented Oct 3, 2024

Hi!

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

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

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.)

@ondras
Copy link
Author

ondras commented Oct 4, 2024

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 #2267

@liZe
Copy link
Member

liZe commented Oct 5, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Questions about how to do something with CSS
Projects
None yet
Development

No branches or pull requests

2 participants