Pdf reader fonts
I love the new embedded pdf reader. One glitch though: for all papers downloaded from Pubmed Central, the fonts are messed up. In these papers, everything appears in one particular sans serif font (I don't know which one), and the spacing is a bit weird. I'm running Zotero 6.0 on linux (xubuntu 18.04). The pdfs look fine on multiple other pdf readers. Thanks!
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7236806/pdf/nihms-1587662.pdf
I am running 6.0.13 on xubuntu and the font is still wrong.
Please note there are thousands of papers formatted like this--it's the default format produced by pubmed central when we upload our manuscripts as required when supported by government funding.
Thanks for checking it out.
browser.display.use_document_fonts
? On my Ubuntu 22.04.1 LTS, when it is set to1
(the default), fonts are correctly rendered. Not when it is set to0
. See the picture below:https://drive.google.com/file/d/1qElTGAQp0D0Lcw_fkJBZqnFzCxDi32CJ/view?usp=sharing
Here is a screenshot showing incorrectly rendered fonts in zotero, next to correct fonts in chrome:
https://freeimage.host/i/PUidVj
In Evince v42.3, the fonts are substituted with NimbusRoman-Regular, NimbusSans-Bold and NimbusSans-Regular respectively.
In Firefox v104.0.2 with pdf.js v2.15.303, the fonts in use are DejaVu Serif, DejaVu Sans and Ubuntu.
I don't know if there is a way to show the fonts used by pdf.js in Zotero.
I had the same problem with flatpak version on Fedora.
It's gone after I switched to the official binary version
You can check if the fonts used in a PDF file are embedded or not with pdffonts(1) (Ref.: https://stackoverflow.com/a/614694/7498073).
pdffonts input.pdf
A workaround is to embed the required fonts. You can use Ghostscript to do that.
This command worked for me (Ref.: https://stackoverflow.com/a/13131101/7498073)
gs -o output.pdf -sDEVICE=pdfwrite -dEmbedAllFonts=true input.pdf
Then just update the PDF file on Zotero.
PD: Strangely, in my case, the PDF without embedded fonts (input.pdf) was 521 KiB, while output.pdf is 263.KiB. I expected it to become bigger since it now contains the fonts.
The issue of some non-embedded fonts not working correctly in the PDF viewer (i.e. pdf.js) has been fixed in the Zotero code as of May 10. However, there hasn't been a new release of Zotero since April. If you're capable of compiling Zotero yourself, then you can have the fix now. Otherwise it should be straightened out in the next release.
Edit: The most recent release (6.0.27) include the pdf.js updates that fix the issue.