We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug I want to register multiple fonts in react-pdf, but blank screen is coming. Only Roboto font is working while creating the pdf.
To Reproduce Steps to reproduce the behavior including code snippet (if applies): Using the code: Font.register({ family: 'Lato', fonts: [ { src: '/font/Lato-Regular.ttf', fontWeight: 400, }, { src: '/font/Lato-Italic.ttf', fontStyle: 'italic', }, { src: '/font/Lato-Bold-Italic.ttf', fontWeight: 500, fontStyle: 'italic', }, { src: '/font/Lato-Bold.ttf', fontWeight: 600, }, { src: '/font/Lato-Bold.ttf', fontWeight: 700, }, { src: '/font/Lato-Bold.ttf', fontWeight: 800, }, ], });
Font.register({ family: 'Lato', fonts: [ { src: '/font/Lato-Regular.ttf', fontWeight: 400, }, { src: '/font/Lato-Italic.ttf', fontStyle: 'italic', }, { src: '/font/Lato-Bold-Italic.ttf', fontWeight: 500, fontStyle: 'italic', }, { src: '/font/Lato-Bold.ttf', fontWeight: 600, }, { src: '/font/Lato-Bold.ttf', fontWeight: 700, }, { src: '/font/Lato-Bold.ttf', fontWeight: 800, }, ], });
Font.register({ family: 'Roboto', fonts: [ { src: '/font/Roboto-Regular.ttf', fontWeight: 400, }, ... same ], });
Font.register({ family: 'Inter', fonts: [ { src: '/font/Inter-Regular.ttf', fontWeight: 400, }, ... same ], });
Expected behavior If used any of the above registered fonts in the body font-family, then the font should come.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
I had the same issue and solved it with this : #2675 (comment)
Sorry, something went wrong.
Thanks a lot that works for me!
No branches or pull requests
Describe the bug
I want to register multiple fonts in react-pdf, but blank screen is coming. Only Roboto font is working while creating the pdf.
To Reproduce
Steps to reproduce the behavior including code snippet (if applies):
Using the code:
Font.register({ family: 'Lato', fonts: [ { src: '/font/Lato-Regular.ttf', fontWeight: 400, }, { src: '/font/Lato-Italic.ttf', fontStyle: 'italic', }, { src: '/font/Lato-Bold-Italic.ttf', fontWeight: 500, fontStyle: 'italic', }, { src: '/font/Lato-Bold.ttf', fontWeight: 600, }, { src: '/font/Lato-Bold.ttf', fontWeight: 700, }, { src: '/font/Lato-Bold.ttf', fontWeight: 800, }, ], });
Font.register({ family: 'Roboto', fonts: [ { src: '/font/Roboto-Regular.ttf', fontWeight: 400, }, ... same ], });
Font.register({ family: 'Inter', fonts: [ { src: '/font/Inter-Regular.ttf', fontWeight: 400, }, ... same ], });
Expected behavior
If used any of the above registered fonts in the body font-family, then the font should come.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: