Loading and registering fonts is broken
See original GitHub issueDescribe the bug
When attempting to load the source of a font, locally or from an external URL, an error comes back as Error: Unknown font format
like in your example here
https://react-pdf.org/repl?example=font-register
To Reproduce Steps to reproduce the behavior including code snippet (if applies):
- Register a font
- See console errors & failure to load the doc
Expected behavior Fonts are loaded successfully and applied to the document.
Screenshots
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:30 (2 by maintainers)
Top Results From Across the Web
Troubleshooting Installed Fonts That Won't Work - Lifewire
Easiest fix: Download and reinstall the correct version of the file, making sure the font is compatible with your operating system.
Read more >How to fix corrupted Fonts in Windows 11/10
1] Reset default font settings using the GUI · 2]Reset default font settings using the Registry · 3] Manually recreate font cache on...
Read more >Troubleshoot font problems | Windows - Adobe Support
A font conflict can occur when you use a damaged font, have too many fonts installed in the Windows registry, or use an...
Read more >Some program installations freeze at "Registering fonts"
Method 1: Perform clean boot on computer and then try installing the program and check. A clean boot helps eliminate software conflicts. How...
Read more >How to Restore Default Fonts in Windows 10 and 11?
This problem can occur after a third-party app is uninstalled, which also deleted several system default font files (up to complete cleaning the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this issue as well. I was able to resolve it by importing the font file as a variable then using that as the src value.
I am also unable to register fonts. code:
code, variation 2:
console:
UPDATE: I was able to get fonts to work using a .ttf url. If you’re using a google font you can do this by curling the google font url
Taking the .ttf url that comes back, and put that into the
src