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

Ligatures do not seem to render #1295

Closed
ghost opened this issue Feb 8, 2021 · 7 comments
Closed

Ligatures do not seem to render #1295

ghost opened this issue Feb 8, 2021 · 7 comments

Comments

@ghost
Copy link

ghost commented Feb 8, 2021

Hi, thanks for this software. Ligatures seemingly don't render.

System: Windows 10
GTK: gtk3-runtime-3.24.24-2021-01-30-ts-win64.exe
Python: Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)]
Version: WeasyPrint==52.2

HTML used to reproduce the bug:

<!DOCTYPE html>
<html>
    <head>
    <meta charset="utf-8">
    <style>
        h1 {
            font-family: "Calibri";
        }
    </style>
    </head>
    <body>
        <h1>atib</h1>
    </body>
</html>

weasyprint bug.html bug.pdf output as rendered by SumatraPDF v3.2 64-bit (zoomed in):

image

Expected output (as rendered by Windows settings):

image

If I add font-variant-ligatures: none; to the style, the full text renders, but the font is gone (I guess Calibri lacks a variant with no ligatures):

image

(As a side-note, I'm unable to display the generated .pdf on Firefox, "This PDF document might not be displayed correctly.", nor Acrobat Reader, "There was an error processing a page. There was a problem reading this document (114).").

@ghost
Copy link
Author

ghost commented Feb 8, 2021

Interestingly, adding an empty <span></span> seems to make it work, so now I have a workaround!

image

(I think it has cached atib and now consistently renders wrong, so I changed it for atic for testing).

@grewn0uille
Copy link
Member

Hi!
Can you share the working and non-working PDFs please?

@ghost
Copy link
Author

ghost commented Feb 8, 2021

Yes, nonworking.pdf and working.pdf.

@ghost
Copy link
Author

ghost commented Feb 8, 2021

With regards to Adobe Acrobat Reader DC (20.013.20074) being unable to read the file, if I hold Control when pressing OK it instead says "Unterminated string.". This is probably the ligature issue, as working.pdf opens fine.

@grewn0uille
Copy link
Member

By looking the files content, it’s caused by a bug in Cairo which generate invalid font name.
You can downgrade Cairo to make it works.

Note: master doesn’t use Cairo anymore

Duplicate #1292

@ghost
Copy link
Author

ghost commented Feb 8, 2021

Okay, thank you for the quick resolution! I also posted a different error on that issue a few minutes ago caused by tables, but yeah, makes sense the Cairo version is buggy.

@ghost
Copy link
Author

ghost commented Feb 8, 2021

Note: master doesn’t use Cairo anymore

I can confirm that pip install git+https://github.com/Kozea/WeasyPrint.git@2c919858c881d8d34eff7ba253e2c0462cb8da40#egg=WeasyPrint gets rid of both this and the linked issue, thank you again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant