pdfjs icon indicating copy to clipboard operation
pdfjs copied to clipboard

Can't load arial font

Open thulnar opened this issue 2 years ago • 1 comments

i'm trying to load arial font (.ttf) but when i load it all text dissapears. This is how i'm loading fonts var arial = fs.readFileSync(__dirname + '/assets/fonts/arial.ttf'); var fontArial = new pdf.Font(arial);

Now this is the pdf with arial output.pdf

and this is the pdf with helvetica (default library font) output.pdf

Any help will be appreciated

thulnar avatar Feb 18 '22 20:02 thulnar

pdfjs uses opentype.js under the hood, can you try uploading your font on this site and check whether it is correctly showing glyphs? https://opentype.js.org/glyph-inspector.html

rkusa avatar Jun 20 '22 10:06 rkusa