-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
Inherited style attributes from parent element is not being applied. #2244
Comments
Hi! Do you have bold Comic Sans installed on your system? |
Yes, since if I apply bold to entire sentence like |
Could you please share your PDF with the wrong font? |
1725022933811.pdf |
Your original example works for me (when I remove the extra quote). Your PDF seems to be rendered using an old version of WeasyPrint. Could you try a recent version? |
I upgraded Weasyprint version 62.3 This is my html code:
This is generated PDF file using the latest version of package. I also tried to test without html wrapper, same issue. |
It works for me. I really do think that you don’t have the bold font installed, it was automatically generated with older versions of WeasyPrint, but it’s not anymore (#1470). What’s your OS, and how did you install Comic Sans? |
I am using MacOS 14.3.1.
|
Could you please share the PDF generated with this HTML? |
Here you go the PDF file. |
Well, it’s installed, and the documentation says it’s installed by default. To be honest, I have no idea why it doesn’t work for you. Do you have the same problem with other fonts? You can try with Futura or Didot, for example. |
Same issue with another font.
All didn't work. :( |
You said "it doesn't work for you". |
Yes, it does work for me.
I use version 62.3 on Linux. Did you install WeasyPrint with Homebrew? |
No, I installed using |
It works for me on latest Gentoo and Ubuntu computers. I’ve never seen this problem before, on countless Linux distributions. And it’s never been reported, as far as I can remember.
It’s really unlikely this error could happen on a fresh Ubuntu 20.04 install, or we would have spotted this before. Is there any specific configuration (maybe a Fontconfig configuration) you may have on both computers?
On MacOS, how did you install the non-Python dependencies, such as Pango and Fontconfig? |
I have no any specific configuration regarding it. I didn't install non-python dependencies such as On Ubuntu, I installed Weasyprint 52.5 because of the dependencies' version conflicts. |
Then they were already installed by another application, maybe with older broken versions. The only documented way to make WeasyPrint work is to use Homebrew, and unfortunately we can’t help you much if you used anything else. You should try with Homebrew, as it’s known to work.
Just to be sure, could you please write <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p><span style="font-family: 'comic sans ms', sans-serif; font-size: 18pt;">Hello world, welcome to <strong>WeasyPrint</strong>.</span></p>
<body>
</html> then try:
and share your PDF? |
I did tested on MacOS with this command line -
These are my python code to generate PDF from html string. |
👍
It’s hard to tell without the whole code, but maybe using a shared |
On Ubuntu - by running
(Sorry, I just noticed that I run Ubuntu server OS By running After activate python
|
That’s Ubuntu 18.04, not 20.04. WeasyPrint is not packaged for 18.04, let’s test with venv then.
You have to install Comic Sans MS. Should work with |
Yes, after install |
Did you try the shared FontConfiguration as explained above? Otherwise, it means that something specific to your project breaks WeasyPrint. You probably know better what your project does, so we can’t really help you about that :/. |
OK, Thanks, I will try more myself, and keep posted here. |
I really don’t know what can cause this issue. |
@codehunter1992 Did you find anything interesting about this issue? |
It was a silly issue. |
Inherited style attributes from parent element is being ignored when builds PDF.
For example,
Word "WeasyPrint" in rendered PDF, has no correct font family and size.
Is there any solution?
The text was updated successfully, but these errors were encountered: