A certain PDF file, generated using Microsoft Word 10.0 on a Windows computer, renders some of its fonts erratically whenever opened on a Debian GNU/Linux box. This odd behaviour happens either on a Debian Lenny or on a Debian Squeeze, both using the latest Acrobat Reader software, that is, 9.4.7, as shown below:
In order to determine what was wrong, we had to analyse the PDF, in order to list all the fonts it was using. We do know that a PDF can have embedded fonts, that is, a bunch of font-descriptor files so that its rendering it’s guaranteed no matter whether the target host does have those fonts installed or not. Thus, the main problem had to be related to those non-embedded fonts, that is, all those ones supposedly installed on the target host.
We ran the pdffonts command, to gather that information. Below, the list of non-embedded fonts we were about to focus on:
So, our theory was more or less like this: those fonts were not installed on the target machines at all, thus the system was in charge of rendering the PDF with any sort of similar ones, thus doing so quite erratically – from a user’s point of view, of course -.
Installing the missing fonts
In order to fix this problem, all we had to do was to install all those missing fonts: Times New Roman (Bold, Italic) and Arial (Bold, Italic). The package providing these fonts is called ttf-mscorefonts-installer, according to the dpkg command:
dpkg -p ttf-mscorefonts-installer
Arial BlackArial (Bold, Italic, Bold Italic)Comic Sans MS (Bold)Courier New (Bold, Italic, Bold Italic)Georgia (Bold, Italic, Bold Italic)ImpactTimes New Roman (Bold, Italic, Bold Italic)Trebuchet (Bold, Italic, Bold Italic)Verdana (Bold, Italic, Bold Italic)Webdings(…)
Thus, we ran the apt-get command to install it:
#apt-get install ttf-mscorefonts-installer
After installing this package, we reopened the PDF using Acrobat Reader and its fonts were well-rendered this time, as shown below:
Whenever an odd behavior concerning fonts is involved, we can use pdffonts to get a complete list of non-embedded fonts, and then check if there is a package on our GNU/Linux distro in order to install them. Easy as pie.