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

Hyphenation not working when a nbsp is present elsewhere in the word #2270

Open
ondras opened this issue Oct 7, 2024 · 3 comments · May be fixed by #2271
Open

Hyphenation not working when a nbsp is present elsewhere in the word #2270

ondras opened this issue Oct 7, 2024 · 3 comments · May be fixed by #2271
Labels
bug Existing features not working as expected

Comments

@ondras
Copy link

ondras commented Oct 7, 2024

I am not sure whether this is a bug or feature. See this rendering:

image

The "x komunikace" is not hyphenated when the space is non-breakable. I would say that it is a bug, because browsers line-break both cases in the same fashion.

@ondras
Copy link
Author

ondras commented Oct 7, 2024

I might have fixed this in a PR: #2271

(I have absolutely zero experience with Pango and the underlying line-breaking algorithm in line_break.py is very complex, so please double-check my code.)

@liZe
Copy link
Member

liZe commented Oct 25, 2024

Here’s what I get with various browsers. Firefox seems to be the only one to do things right.

Chrome:
Image

Firefox:
Image

Gnome Web:
Image

Here’s what I get with WeasyPrint:
Image

WeasyPrint can break the first word correctly, but not the second one.

@liZe liZe added the bug Existing features not working as expected label Oct 25, 2024
@ondras
Copy link
Author

ondras commented Oct 25, 2024

Right. The issue is visible when the hyphenation opportunity is in the second word (of the nbsp-joined word pair). This is very typical for Czech typography, where we join a one-letter word with the (longer) following word using a nbsp (as seen in my first post).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants