PDF Font Embedding

Joshua LeVasseur

LaTeX Output

To enable PDF font embedding in utilities such as dvipdfm, change the file updmap.cfg (located in, for example, /opt/local/share/texmf/web2c). In this file are declarations for the various utilities to enable "downloading" of the basic fonts. For example, enable dvipdfmDownloadBase14 to ensure that dvipdfm embeds all the basic fonts in its PDF output. After changing the updmap.cfg file, run the updmap utility to regenerate all of LaTeX's font map files.

But this isn't enough ...

Images

The LaTeX font embedding configuration will likely be ignored when eps images are integrated into your document. Thus generate eps files which have their fonts embedded. If saving a graphic in a Windows program as eps, enable the options to embed the fonts. If generating a plot with gnuplot, use the fontfile option of the postscript terminal (which requires a recent version of gnuplot).

gnuplot

Tell gnuplot to embed the entire font file in the output eps file. An example: set terminal postscript eps enhanced "NimbusSanL-Regu" fontfile "uhvr8a.pfb" This strange command embeds gnuplot's default Helvetica font in the output. The name of the font is NimbusSanL-Regu, and the font file is uhvr8a.pfb. The Nimbus fonts are a family of free fonts distributed with LaTeX. The font file has a line, near the top, which defines the abbreviated font name: /FontName /NimbusSanL-Regu def Look for similar lines in other font files if you want to change the font. My file is located at /opt/local/share/texmf/fonts/type1/urw/helvetic/uhvr8a.pfb

My installation of dvipdfm and LaTeX choose the Nimbus font family for the Times font, and so I chose the same family for the Helvetica font. Other families may be incompatible with gnuplot; for example, in my experience, the Adobe afm fonts are unsupported.

dvipdfm

The dvipdfm utility converts eps images into pdf images, and by default, using ghostscript. You can control the conversion and thus adjust image compression and font embedding characteristics. Font embedding should be enabled by default.

The -D command line parameter of dvipdfm sets the command for converting eps to pdf, where %i is the name of the input file, and %o is the name of the output file. An example:

-D "cat %i | gs -q -dCompatibilityLevel=1.2 -dUseFlateCompression=true -dSAFER -sDEVICE=pdfwrite -sOutputFile=%o -sPAPERSIZE=a0 -dPDFSETTINGS=/prepress - -c quit" This is essentially the default command line used by dvipdfm, but with the additional option -dPDFSETTINGS=/prepress (which enables a package of pdf output settings for pre-press quality). You can discover additional ghostscript options via the ps2pdf command. Supposedly, ghostscript accepts most of the options available to Adobe's Distiller.

If you have access to Adobe's Distiller, you can configure dvipdfm to use it rather than ghostscript.