Open malyzeli opened 7 years ago
Is it possible to see the font file, so that it can be run through a few tools like TTX, Font Validator (the new one) and FontForge to see if there's anything that they flag might not be quite correct? (some not-quite-correct fonts can still be loaded by some applications, but the stricter the parser, the more likely they become rejected)
Hello,
I'm trying to generate PDF with
pdfkit
using custom TTF font my friend made, but I'm stuck on error which I don't understand. I spent hours googling and trying to solve it on my own, unfortunately without success. Any help will be appreciated.The font is made in Corel Draw X6 and in other applications it works - I had success generating PDF from MS Word on Windows and from LibreOffice Writer on Ubuntu Linux - which is why I believe the problem is not in the font file.
I'm building React application using Webpack, where I want to dynamically generate PDF from user input. I tried
pdfkit
for generating PDF using default font and it works well.I'm using
url-loader
to embed font as base64 data url into the application at the compile time.Then I decode the string into Buffer on runtime.
And then I want to use the font when generating the PDF.
At first I tried this way ...
... which lead me to this error, so I dropped the third argument and this is my last attempt, where I'm stuck now.
Now I'm getting this error stack - relevant lines highlighted with asterisk.
This is the place where the error occurs, on line starting with
var lang
.Can somebody tell me where is the problem? Or provide me with working code how to embed custom font?