-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
Fonts breaking in v62 #2144
Comments
Hi! Could you please share the PDF files, generated with the |
I've found a similar issue with these cases:
I attached the files for the second case with a combination of good/bad/compressed/uncompressed, also see 2nd page. TestDocument-bad.pdf TestDocument-26-good-uncompressed.pdf
|
@schneebuzz Could you please share the HTML, CSS and fonts for your example? I’m not sure that your problem is the same as the original one. @LukasKlement Do you use WeasyPrint on WSL2 too? |
I am using weasyprint's python API to render my PDF files. My application is running in a docker container with an image based on 💡 After some testing, I observed that when I cache the @liZe see attached zip for the sources, I used the following
|
We’ve found where the problem comes from, it looks like the bug is the same for both of you. |
Calculating the description hash is cheap, but we really should cache this in the FontConfiguration object where the Pango map is stored. Fix #2144.
@LukasKlement @schneebuzz Could you please test the This bug only happens when we render multiple documents in the same process (ie not from the command line). I couldn’t reproduce it on my computer, it never happened on CI, but it was quite easy to reproduce on your Docker image. As it depends on the way Pango manages the memory, it can happen randomly depending on many factors (OS, Pango version, Python version, etc.) Sorry for the inconvenience. |
@liZe using the Thanks for fixing it in just a couple of hours 🥳 |
(For the record: this issue is related to #2130.) |
With v62, fonts appear to randomly break when rendering a PDF, but not consistently. Here is a screenshot of the same PDF being rendered twice in a row, once the result is wrong, once correct:
#1 Wrong: https://share.zight.com/L1ub4Oko
#2 Correct: https://share.zight.com/12ul5KDP
It happens with all kinds of fonts, it's not limited to a single font family.
The text was updated successfully, but these errors were encountered: