Karakas Online

7.3.1. Embedding Computer Modern fonts

The reason behind embedding the Type1 Computer Modern fonts in PostScript® (PS) documents is the same as for PDF ones (see Section 7.2.3): the resolution of the bitmapped fonts that are used by default by TeX/LaTeX matches that of the printer on the system you create the document. This is rarely the same resolution of the monitor or printer the reader will use. This change in resolution results in terrible quality when displaying these fonts on a screen. or printing it on a printer, whose resolution does not match the one of the bitmapped font.

Tip Tip:
 

In recent TeX/LaTeX distributions, freely available Type1 versions of the CM fonts are provided. These appear under the collective name of bluesky. The bluesky fonts can be obtained from CTAN, if not already installed on your system.

You can embed the CM fonts in the PS document using an aproppriate printer with the -P option:

PRINTER="cmz"
export PRINTER

I use this comfortable method in the lyxtox script. This will make dvips (which is directly called in the current lyxtox script, or indirectly called by sgmltools, in older versions of lyxtox, see Section 7.1.4.9) to read the configuration file config.cmz (under /var/lib/texmf/dvips/config/config.cmz on my system). On my system, this file contains only one line:

p +psfonts.cmz

and looking at the psfonts. cmz file (located in /usr/share/texmf/dvips/bluesky/psfonts.cmz, notice the name “bluesky” in the directory path), I can see that all the necessary mappings from short names to full ones are there. Here are some lines of psfonts.cmz:

cmb10           CMB10           <cmb10.pfb
cmbsy10         CMBSY10         <cmbsy10.pfb
cmbx10          CMBX10          <cmbx10.pfb
cmbx12          CMBX12          <cmbx12.pfb
cmbx5           CMBX5           <cmbx5.pfb
cmbx6           CMBX6           <cmbx6.pfb
cmbx7           CMBX7           <cmbx7.pfb
cmbx8           CMBX8           <cmbx8.pfb
cmbx9           CMBX9           <cmbx9.pfb
cmbxsl10        CMBXSL10        <cmbxsl10.pfb

If no map file like the above can be found, you probably miss something from your distribution, unless you installed TeX/LaTex by hand, in which case you know what you are doing and might try the following (see LaTeX to PDF Guide):

Search for a file pdftex.map (see Section 4.3) in your TeX distribution (located in /var/lib/texmf/dvips/config/pdftex.map on my system). Run a Perl script as follows:

perl -ne '($font, @rest) = split(/ /);
                  $uc = $font;
                  $uc =~ tr/a-z/A-Z/;
                  print "$font $uc @rest";
                 ' PATH-TO-PDFTEX-MAP/pdftex.map
                 > cm.map

The created cm.map file instructs dvips to embed the Type1 outline fonts for the Computer Modern fonts into the resulting PostScript® file.

Add to your presonal .dvipsrc the following line

p +PATH-TO-CM-MAP/cm.map 

This tells dvips to use the font map you just created in addition to the system-wide configuration files.

The LyX User's Guide (available through the menu: Help-->User's Guide) contains a whole chapter devoted to the configuration of dvips and Ghostscript for LyX (Section 2.6, as of LyX 1.2.0), which is definitely recommended reading.

Last updated Mon Sep 24 01:19:25 CEST 2007 Permalink: http://www.karakas-online.de/mySGML/embedding-computer-modern-fonts.html All contents © 2002-2007 Chris Karakas