6

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.

  • Can you please check if the lubuntu-desktop package is installed. – Gunnar Hjalmarsson Apr 18 at 14:39
  • Thanks for the suggestion. I checked and it was not installed. Installing the package and all its dependencies did however not solve the problem. – W. Verbeke Apr 18 at 16:21
  • 1
    The file is properly rendered for me when using Firefox, but the delta character is not shown with Evince. I have the fonts-opensymbol package installed, and it ought to do it. Can't explain why Evince fails to find it. – Gunnar Hjalmarsson Apr 18 at 17:09
  • My Atril on Ubuntu 16.04 LTS shows diameter instead of \delta (see image). Along with GIMP and pdf2svg. But Acroread, pdf2htmlEX and pdf2ps shows ∆. What is interesting the LibreOffice Draw can't import this pdf-file. So I suspect that PDF producer "ROOT Version 6.10/09" is buggy. I do not know how ROOT works, but consider to use LaTeX notation for greek symbols instead of Unicode (if you doing so). – N0rbert Apr 18 at 17:57
  • ROOT is a data analysis package used at CERN. When creating the plots, latex code is given to ROOT, but what it does with that internally to create the plot is not clear to me. The interesting thing is though that I never had issues displaying similar plots made in ROOT (also with the \Delta symbol) when using lubuntu 16.04. So it would naively seem to me that there should be a way to get evince to display it correctly, regardless of what ROOT might do wrong or not. – W. Verbeke Apr 18 at 21:17
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.