-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fontWeight doesn't work #796
Comments
@yellowBanano fontWeight won't apply if you didn't register proper font.
|
+1 |
1 similar comment
+1 |
+1, Still doesn't work in workaround: |
i'm using the latest version and still facing this issue |
Fixed in latest commits! |
this doesnt work even with the default fonts built in. are you saying i have to import all the bold fonts even for the default fonts built in? |
This issue is still unresolved on the latest version. |
Any solution just yet? Still have the issue. |
any solution? |
1 similar comment
any solution? |
I used this package here link to get font weight working. One more important thing we must have to register font family first. after this use tag from react-pdf-html to render in pdf
|
I had the same issue. Thanks to all who commented. Following advices above, this was what worked for me: First, run the register code somewhere central in the app.
And then add the font family where font weight is used in the document pdf.
|
Like @ua-knight said above: IT DOESN'T WORK if 'fontFamily' is not specified inside style tag. Took me a while too. |
It worked. |
You can use the default fonts provided by the library without needing to register another font if they fit your needs. The default fonts are listed here: https://react-pdf.org/fonts For example:
|
not working for me |
someone find another solution because all the above-suggested solutions are not working yet My project uses Nextjs 14.1.1 with Shadcn UI that uses remix UI |
+1 |
It was working before in version 14.0.3, but when I updated to the next version, it stopped working again. Even after reverting to the previous version, it still doesn't work |
Same deal here. Worked in 3.1.14 but not working in 3.4.4. Even the built-in fonts are not working at all. |
Same here.. I had to revert react-pdf/renderer to 3.2.2 from 3.4.4. |
@Psarada84 Which version did you revert to? (Looks like 3.2.2 is not a release) - Hoping it might be a solution for me because I have tried versions from 3.1.2 up - on vanilla React 18.3 - and none of those I've tried so far have worked for me even with the 'Helvetica-Bold' built-in example shown above. |
Never mind the above - I found a solution for this (using the default fonts at least) here - #2750 - putting in an override to revert |
HI I have tried all of the above and i cannot have a single word in bold within a sentence. Any Ideas, thanks |
Has this been solved? Because I can't seem to figure out how to make some text bold. |
Working Solution for Text Alignment and Wrapping in
|
After checking multiple threads here the only way it worked for me was overriding the
|
Describe the bug
I tried to change the text style of a component with CSS property fontWeight.
Nothing has changed.
Use https://react-pdf.org/repl?example=font-register to check the accuracy, but repl won't launch.
To Reproduce
Steps to reproduce the behavior including code snippet (if applies):
Expected behavior
Expected to see how font become bold
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: