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

Weasyprint seems to turn ligatures off when text is justified. #1469

Closed
baldurbjarnason opened this issue Oct 12, 2021 · 4 comments
Closed
Labels
bug Existing features not working as expected
Milestone

Comments

@baldurbjarnason
Copy link

So, I've been testing weasyprint for creating PDFs from blog posts and noticed that the font ligatures disappeared when text is justified, then reappear when ragged right.

Output of weasyprint --info:

System: Linux
Machine: x86_64
Version: #1 SMP Wed Feb 19 06:37:35 UTC 2020
Release: 4.19.104-microsoft-standard

WeasyPrint version: 53.0
Python version: 3.8.10
Pydyf version: 0.0.3
Pango version: 14407

I tried reinstalling weasyprint and supporting libraries from scratch as well as tried installing the latest version. I'm using Ubuntu 20 on WSL. That shouldn't be affecting the results but I'm mentioning it in case it does.

I've tried web fonts and built-in fonts, same result. Sometimes spans, ems or marks in paragraph text do get ligatures, but only if the text in them is short, AFAICT.

I've put together a simple test page using a selection of open source fonts to show the issue:

https://www.baldurbjarnason.com/weasytest/weasyprint-test.html

The output PDF using my install of weasyprint:

https://www.baldurbjarnason.com/weasytest/weasyprint-test.pdf

I've also zipped up the test site and attached to this issue.
weasytest.zip

Very curious to find out what is going on 😄 Maybe it's an issue with my version of Pango?

@liZe liZe added the bug Existing features not working as expected label Oct 12, 2021
@liZe liZe added this to the 53.4 milestone Oct 12, 2021
@liZe
Copy link
Member

liZe commented Oct 12, 2021

Hello!

So, I've been testing weasyprint for creating PDFs from blog posts and noticed that the font ligatures disappeared when text is justified, then reappear when ragged right.

You’re right, there’s a dirty bug. The bug is caused by the letter-space parameter being set, even if it’s 0, when the space between words is changed (and it is when the text is justified). It’s actually easy to fix, the hardest part will be to write a new unit test 😉.

We can expect a bug fix before the end of the week.

@baldurbjarnason
Copy link
Author

Awesome to hear that it's an easy fix 👍

@liZe liZe closed this as completed in 0524421 Oct 13, 2021
@liZe
Copy link
Member

liZe commented Oct 13, 2021

It’s fixed and tested in the 53.x and master branches, real-life tests are welcome if possible 😉.

@baldurbjarnason
Copy link
Author

Ran my tests again using master and it's fixed! All good 😎👍

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

No branches or pull requests

2 participants