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!
  • Have the same issue with Ubuntu 22.04.1 LTS and Zotero 6.0.12
  • could you link to a couple of specific papers to make sure we're looking at the same thing? Also, make sure you're using the most recent Zotero version (6.0.13)
  • Here's an example:

    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.
  • I can't reproduce. Could someone make a screenshot demonstrating the issue?
  • edited September 13, 2022
    Did you modify something in the advanced configuration, particularly browser.display.use_document_fonts? On my Ubuntu 22.04.1 LTS, when it is set to 1 (the default), fonts are correctly rendered. Not when it is set to 0. See the picture below:

    https://drive.google.com/file/d/1qElTGAQp0D0Lcw_fkJBZqnFzCxDi32CJ/view?usp=sharing
  • I didn't modify the configuration, that field is set to 1 for me.

    Here is a screenshot showing incorrectly rendered fonts in zotero, next to correct fonts in chrome:

    https://freeimage.host/i/PUidVj
  • I cannot reproduce on a recent version of Ubuntu. All I can say is the fonts, non embedded in the documents, are (according to Evince) Times-Roman, Helvetica-Bold and Helvetica.

    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.
  • Okay well it's pretty clear that the problem arises when fonts are NOT embedded. All my pdfs render fine when fonts are embedded. But when they are not embedded, the zotero pdf viewer replaces them all with a single weird font, resulting in lots of spacing issues. This even happens for fonts which are actually on my system (e.g. I have Times New Roman installed, but it still gets replaced).
  • Maybe it's because you're using flatpak or snap version.
    I had the same problem with flatpak version on Fedora.
    It's gone after I switched to the official binary version
  • had the same issue, for me installing texlive-scheme-full did the trick
  • For me the issue was *only* with PDFs without embedded fonts. I don't know why Zotero's PDF viewer, which in my system (Arch Linux) is Firefox's pdf viewer (I think it's pdf.js https://mozilla.github.io/pdf.js/ but don't quote my on that) uses that ugly font with bad kerning.

    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.
  • edited September 28, 2023
    Sorry to necrobump; I wanted to update this thread in case anyone else finds it while trying to troubleshoot this issue.

    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.
Sign In or Register to comment.