I now understand better the choice of these 14 fonts, which happen to be the so-called “base 14 fonts”, that is fonts that do not need to be embedded into PDF documents because they were chosen by Adobe in this purpose. I’m not sure about the license issue then, it’s not clear.
Anyway, in case someone would be interested in changing the font in a PS, EPS or PDF file, here is a quick and dirty trick :
- PS file : Edit the file with a text editor and replace all the occurrences of the unwanted font (the default being Helvetica-Bold for ROOT figures) by the name of the wanted one (for instance LiberationSerif-Regular), then save the file.
- EPS file : Same process, but for some reason you have to remove the four following lines at the beginning of the file :
/reEncode {exch findfont dup length dict begin {1 index /FID eq {pop pop} {def} ifelse } forall /Encoding exch def currentdict end dup /FontName get exch definefont pop } def [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica
/Helvetica-Oblique /UnPilgi /UnPilgiOblique /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi
/Bookman-DemiItalic /Bookman-Light /Bookman-LightItalic /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold
/NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic /Palatino-Bold /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman ] {ISOLatin1Encoding reEncode } forall
- PDF file : Same process as for PS files.
Notes :
- The name of the font to use is the name of the corresponding ttf file in /usr/share/fonts, that is without the ttf extension but with the same letter case and dashes.
- This won’t work for every fonts. For instance, I cannot manage to get it working with Computer Modern (cmr10).
- This is a trial and error workaround, I’m not sure I understand what it actually does. I mean, this is not what I would call “font embedding” since it is just a call to some existing font on the system, and not even ps fonts, so I have not tried yet but it will probably not display correctly on another computer (hopefully it will fall back to default fonts though).
Edit : Ok, now I got the embedding part. So if you want for instance to use a Computer Modern font (LaTeX’s default), just compile a tex file into a ps one, edit it with a text editor, copy the lines between “%%BeginFont: CMR10” (for Computer Modern, aka CMR) and “%%EndFont” and paste them between the “%%BeginSetup” and “%%EndSetup” lines of the PS or EPS file you want to use it. Then change the font inside your file to be CMR10 as explained above. Beware that for small figures it may dramatically increase the file size. Beware also that all the needed characters should be defined in the file from which you take the font, otherwise they will appear as blank spaces.
Edit2 : Just noticed that this solution had already been given by jklukas, and also have the spacing issue. The workaround would be either to manually adjust spaces beforehand, which is very painful, or to manually adjust them inside the PS/EPS file, which is still painful though a bit less IMO.