Ubuntu – Problem displaying pdf files after update to lubuntu 18.04

evincefontslubuntupdf

Recently I updated my lubuntu version from 16.04 to 18.04 and since then I have had issues displaying certain symbols pdf plots (using evince). The pdf file I am trying to display is the following:

https://www.dropbox.com/s/mc2wp2y8q2af1vj/stupidPlot.pdf?dl=0

On my screen it appears as in the following screenshot:

wrong_display

while it should appear as follows:

correct_display

So the greek symbols delta, gamma and capital delta are not displayed as expected. After some searching I suppose it must be related to the fact that the fonts are not embedded in the pdf file I am trying to read (though I am not sure, so correct me if this is not the case). pdffonts gives the following output:

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
Times-Italic                         Type 1            WinAnsi          no  no  no       7  0
Times-Bold                           Type 1            WinAnsi          no  no  no       8  0
Times-BoldItalic                     Type 1            WinAnsi          no  no  no       9  0
Helvetica                            Type 1            WinAnsi          no  no  no      10  0
Helvetica-Oblique                    Type 1            WinAnsi          no  no  no      11  0
Helvetica-Bold                       Type 1            WinAnsi          no  no  no      12  0
Helvetica-BoldOblique                Type 1            WinAnsi          no  no  no      13  0
Courier                              Type 1            WinAnsi          no  no  no      14  0
Courier-Oblique                      Type 1            WinAnsi          no  no  no      15  0
Courier-Bold                         Type 1            WinAnsi          no  no  no      16  0
Courier-BoldOblique                  Type 1            WinAnsi          no  no  no      17  0
Symbol                               Type 1            Symbol           no  no  no      18  0
Times-Roman                          Type 1            WinAnsi          no  no  no      19  0
ZapfDingbats                         Type 1            ZapfDingbats     no  no  no      20  0
Symbol                               Type 1            Symbol           no  no  no      21  0

I tried to fix it using the suggestion given on:
https://stackoverflow.com/questions/10277418/the-pdf-viewer-evince-on-linux-can-not-display-some-math-symbols-correctly to run GhostScript as follows:

gs -o gs-repaired—stupidPlot.pdf -dPDFSETTINGS=/prepress -sDEVICE=pdfwrite stupidPlot.pdf

which does not seem to work and gives the error:

   **** Error: Encountered 'obj' while expecting 'endobj'.
               Treating this as a missing 'endobj', output may be incorrect.
   **** Error: Encountered 'obj' while expecting 'endobj'.
               Treating this as a missing 'endobj', output may be incorrect.
Processing pages 1 through 1.
Page 1
Loading NimbusSans-Regular font from /usr/share/ghostscript/9.26/Resource/Font/NimbusSans-Regular... 5086732 3571608 2679472 1286852 4 done.
Loading StandardSymbolsPS font from /usr/share/ghostscript/9.26/Resource/Font/StandardSymbolsPS... 5119500 3664456 2699672 1302649 4 done.

   **** This file had errors that were repaired or ignored.
   **** Please notify the author of the software that produced this
   **** file that it does not conform to Adobe's published PDF
   **** specification.

**** The rendered output from this file may be incorrect.

Moreover I have to produce many (tens of) thousands of pdf plots, so it would be preferable not to have to embed fonts in them in order to display them correctly.

So I wonder if anyone knows what might have changed when updating from lubuntu 16.04 to 18.04 (in 16.04 the plots were always correctly displayed), and how I could correctly display the pdf's in evince, preferably without having to embed the fonts in the pdf.

I also tried using xpdf and okular as alternatives to evince, but they displayed the symbols wrongly in the same manner.

Best Answer

Opening the file in Adobe Illustrator you'll find out that the glyph font is actually https://en.wikipedia.org/wiki/Symbol_(typeface) It likely comes with e.g. Adobe Reader, but not with evince. At the same time you probably don't have the font installed as system font, so there is nothing to fall back to. Props to envince for not silently substituting it with other font.

Last thing that could make this display correctly is if the font was embedded at creation with the file (full info within the pdf itself). However based on https://root-forum.cern.ch/t/embed-fonts-in-pdf/21666/2 ROOT does not allow to embed fonts to keep the file size small.

tl;dr Make sure the font is set to "Helvetica" which unless on mac will give you Arial, but either way you should be able to display the symbols correctly then.

Related Question