When I try to register a font with Font.register() and then I try to style a Text, the document is just loading.
Even in the documentation the error occurs. When you remove fontFamily from all Text, the pdf is rendered. Am I doing something wrong?
Here is repl.it:
https://react-pdf.org/repl?example=font-register
The issue may relate to the following: #806 #796 #793
Can you try importing the font directly in your import statements of JS file like
_import someFont from 'someDir/Lato-Italic.ttf';_
and then use _someFont_ in your src attribute of Font.register().
The only disadvantage is that you have to import all the fonts individually.
I think I still have issues to load fonts properly. In my case, I am trying to load the Korean language.
But, I can see only few alphabets. the other alphabets are not invisible.
Is there any workaround I can apply?
Thanks a lot @NishRaj I was struggling for last 3 days just to solve this issue, and finally with your suggestion of importing font directly as a JS import it worked, earlier I was not able to render non latin characters by any means. Thanks again.
+1
Most helpful comment
Can you try importing the font directly in your import statements of JS file like
_import someFont from 'someDir/Lato-Italic.ttf';_
and then use _someFont_ in your src attribute of Font.register().
The only disadvantage is that you have to import all the fonts individually.