Ghostscript Font Management

Linux's printing system has traditionally worked under the assumption that the printer understands PostScript, but most printers sold for the home and small business markets don't meet that requirement. To fill the gap, Linux uses Ghostscript to convert PostScript into a format that the printer understands. Essentially, Ghostscript is a PostScript interpreter that resides on the computer rather than on the printer. As such, Ghostscript is responsible for printer font management.

PostScript printers all ship with a standard set of fonts available, including Times, Helvetica, and Courier, and Ghostscript makes them available, as well. All Linux systems also ship with these fonts installed in X. Some word processors, though—most notably KWord—require that you install additional fonts in your PostScript printer or in Ghostscript in order for them to be used. Consult your printer's documentation for information on installing a font in your printer. If you're using Ghostscript, you can install a font by storing the font file in an appropriate directory and adding an entry to a configuration file.

Note You don't need to add fonts to Ghostscript when using OpenOffice.org, AbiWord, or some other word processors; these programs send the font to the printer along with the file being printed.

Most distributions place Ghostscript fonts in the /var/lib/defoma/gs.d/dirs/fonts, /usr/share/fonts/default/ghostscript, or /usr/share/ghostscript/fonts directory. Ghostscript works best with Adobe Type 1 fonts, but Ghostscript also supports TrueType fonts—if the program was compiled with this option, which not all Ghostscript executables include. When installing Type 1 fonts, you need to copy two files per font, one with a .pfb or .pfa filename extension and one with a .pfm or .afm extension. TrueType fonts come in single files, all of which have .ttf extensions.

Tip If you want to use the same fonts for printing and for X screen displays, you can save some disk space by either using symbolic links between the X font directory's files and the Ghostscript font directory's files or by using the same directory for both locations. For instance, you can add the Ghostscript font directory to X's font

This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to regist* path and place X fonts.dir and fonts.scale configuration files in this directory.

Once you've copied font files to a directory, you need to tell Ghostscript to use them by editing a file called Fontmap or Fontmap.GS, which is usually in the /var/lib/defoma/gs.d/dirs/fonts or/usr/share/ghostscript/vers/on/lib directory, where version is the Ghostscript version number, such as 7.05. Fundamentally, this file consists of a series of name assignments of one of the following two forms:

/PostScript-Font-Name (font-filename.ext); /New-Font-Name /PostScript-Font-Name;

The first form assigns a font file stored in the font directory to a PostScript font name. (This directory's location is hard-coded in the Ghostscript executable, but it varies from one distribution to another.) The second form defines an alias—when a PostScript file requests a font called /New-Font-Name, Ghostscript looks up the font associated with /PostScript-Font-Name. To add fonts, you add definitions of this form. An alias might or might not be useful. They're common in the default font file because many of Ghostscript's fonts are clones of more common fonts—for instance, instead of Adobe Times, Ghostscript uses a similar font called Nimbus Roman. Thus, Ghostscript defines Nimbus Roman (or /NimbusRomNo9L-Regu, to be precise) as the primary font and sets up Times (or/Times-Roman) as an alias. For most purposes, the configuration would work as well with /Times-Roman pointing directly to the target font file.

Tip If you want to add a lot of fonts, you can use the typelinst program, described more fully in Chapter 16, to create aFontmap file with entries for all the Type 1 fonts in a directory.

Team LIB

Team LiB

^ previous

0 0

Post a comment