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

Generated PDF differs slightly from sample on weasyprint site #954

Closed
espechtcfe opened this issue Sep 27, 2019 · 5 comments
Closed

Generated PDF differs slightly from sample on weasyprint site #954

espechtcfe opened this issue Sep 27, 2019 · 5 comments
Labels
bug Existing features not working as expected
Milestone

Comments

@espechtcfe
Copy link

When generating a PDF of the "Report" sample using Weasyprint 50, I'm seeing a difference in the PDF when compared to the sample on the weasyprint site.

I've attached the PDF that is being generated. If you compare the typography features page (page 8) with the version on the weasyprint site, you'll notice that in the one I generated, the copy in the Ligatures and Numbers sections includes line breaks that don't exist in the version on the website.

I've installed Weasyprint 50 using this docker image - https://hub.docker.com/r/minidocks/weasyprint - which I modified by changing the Dockerfile to specify version 50. I have verified that version 50 is running in the container. The command I'm running from a folder above the report folder to generate the report is:
docker run --rm -v pwd:/app -w /app minidocks/weasyprint:latest ./report/report.html weasyprint_test.pdf

Thank you for looking into this. I'm just getting started with Weasyprint and am very impressed with the product!
weasyprint_test.pdf

@liZe liZe added this to the 51 milestone Sep 27, 2019
@liZe
Copy link
Member

liZe commented Sep 27, 2019

There's also a difference in the small caps text. I have to find what's wrong.

Thank you for looking into this. I'm just getting started with Weasyprint and am very impressed with the product!

😄

@knixeur
Copy link

knixeur commented Nov 26, 2019

Ok, that was hard to find.
There's a problem with font-variants that was introduced in v44 (v43 works fine).
The problem is that a new Pango attribute list is being generated and replacing the current attributes.

https://github.com/Kozea/WeasyPrint/blob/master/weasyprint/text.py#L769
https://github.com/Kozea/WeasyPrint/blob/master/weasyprint/text.py#L783

Replaces the attributes generated on setup https://github.com/Kozea/WeasyPrint/blob/master/weasyprint/text.py#L728

@knixeur
Copy link

knixeur commented Nov 26, 2019

Ok, I made a PR but doesn't fix Ligatures and Numbers, it does fix small-caps example. If I open report.html in a browser I see break lines in Ligatures and Numbers examples.

@knixeur
Copy link

knixeur commented Nov 26, 2019

Line breaks in Ligatures and Numbers "broke" between v45 and v46

Edit: I think it's not broken,

tags have 100% width

html body article#typography section#ligatures dl dd {
    flex: 1 100%;
    margin: 0;
    padding: 0;
}

@liZe
Copy link
Member

liZe commented Dec 15, 2019

@knixeur Thanks a lot, your comments (and your PR) were really, really useful ❤️.

@liZe liZe added the bug Existing features not working as expected label Dec 17, 2019
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

3 participants