-
Notifications
You must be signed in to change notification settings - Fork 54
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
@font-face declared fonts not embedded in pdf #54
Comments
Thank you for your pull-request! I agree with @foarsitter and prefer keeping the Please check out the solution in the develop branch. Does this work for you? |
Sorry for my late response. I checked it out, but now I've the problem that Weasyprint requires pango >= 1.44. I still run Buster, so I am going to dist-upgrade, then come back here. |
Bullseye will indeed solve the pango issue. |
Now running Bullseye and everything looks great so far. Your solution works for me, my fonts are now correctly embedded as shown below:
The pdffonts output looks a bit different to the one shown above in my first post, though, as it does not show the font-weight anymore in the name column and the type and encoding columns also differ. But my PDF looks nice, so I don't care. |
thank you for verifying! fix released... |
Hello, I recently started using django-weasyprint in a project to produce nice pdf-reports. However, the fonts I declared in my css using
@font-face
rules were not embedded in the final pdf.This is probably due to a missing
font_config
attribute when django-weasyprint instanciates css objects. According to weasyprint docs, you should declare thefont-config
attribute also on css instance when using font-face rules. I tested it by writing a function view that directly uses weasyprint.So I downloaded the latest stable version of django-weasyprint and fixed it locally. I'll create a pull request.
The output of
pdffonts
command before the fix:and after the fix:
Regards Oliver
The text was updated successfully, but these errors were encountered: