Table of contents
- About Ghostscript fonts
- Ghostscript's free fonts
- How Ghostscript gets fonts when it runs
- Platform fonts
- Adding your own fonts
- For developers only
- Using Ghostscript fonts on X Windows displays
For other information, see the Ghostscript overview.
Ghostscript is distributed with two kinds of files related to fonts:
- the fonts themselves in individual files, and
- a file "
Fontmap" that defines for Ghostscript which file represents which font.
Additionally, the file
cidfmap can be used
to create substitutes for CIDFonts referenced by name in Postscript and PDF jobs.
See the section on CID Font Substitution
for details. NOTE: care must be exercised since poor or incorrect output may result
from inappropriate CIDFont substitution. We therefore strongly recommend
embedding CIDFonts in your Postscript and PDF files if at all possible.
The "base 35" fonts required for Postscript (and "base 14" required for PDF) are Postscript Type 1 font files.
When Ghostscript needs a font, it must have some way to know where to look
for it: that's the purpose of the
Fontmap file, which
associates the names of fonts such as
with the names of font files, such as
Fontmap can also create
aliases for font names, so that for instance,
/NimbusNo9L-Regu means the same font as
- 35 commercial-quality Type 1 basic PostScript fonts -- Times, Helvetica, Courier, Symbol, etc. -- contributed by URW++ Design and Development Incorporated, of Hamburg, Germany (http://www.urwpp.de/). Fontmap names them all.
Fonts occupy about 50KB each, so Ghostscript doesn't load them all
automatically when it runs. Instead, as part of normal initialization
Ghostscript runs a file
gs_fonts.ps, which arranges to load
fonts on demand using information from the font map. To preload all of the
known fonts, invoke the procedure
lib/prfont.ps contains code to print a sample page of
a font. Load this program by including it in the
command line or by invoking
Then to produce a sampler of a particular font XYZ, invoke
For more information about how Ghostscript loads fonts during execution, see here.
Ghostscript can use any Type 0, 1, 3, 4, or 42 font acceptable to other PostScript language interpreters or to ATM, including MultiMaster fonts. Ghostscript can also use TrueType font files.
To add fonts of your own, you must edit Fontmap to include at the end an entry for your new font; the format for entries is documented in Fontmap itself. Since later entries in Fontmap override earlier entries, a font you add at the end supersedes any corresponding fonts supplied with Ghostscript and defined earlier in the file. To ensure correct output, it is vital that entries for the "base 35" fonts remain intact in the Fontmap file.
In the PC world, Type 1 fonts are customarily given names ending in
.PFB. Ghostscript can use these
directly: you just need to make the entry in Fontmap. If you want to use
with Ghostscript a commercial Type 1 font (such as fonts obtained in
conjunction with Adobe Type Manager), please read carefully the license that
accompanies the font to satisfy yourself that you may do so legally; we take
no responsibility for any possible violations of such licenses. The same
applies to TrueType fonts.
Ghostscript provides a way to construct a (low-quality) Type 1 font from a
bitmap font in the BDF format popular in the Unix world. The shell script
bdftops (Unix) or the command file
bdftops.bat (DOS) converts a BDF file to a
scalable outline using
bdftops.ps . Run the
bdftops BDF_filename [AFM_file1_name ...] gsf_filename fontname
UniqueID [XUID] [encodingname]
The arguments have these meanings:
Input bitmap file in BDF format
AFM files giving metrics (Optional)
Name of the font
UniqueID (as described below)
XUID, in the form
n1.n2.n3...(as described below)
"StandardEncoding" (the default), "ISOLatin1Encoding",
bdftops pzdr.bdf ZapfDingbats.afm pzdr.gsf ZapfDingbats 4100000 1000000.1.41
Then make an entry in Fontmap for the
pzdr.gsf in the example) as
The rest of this document is very unlikely to be of value to ordinary users.
As noted above, Ghostscript accepts fonts in the same formats as PostScript interpreters. Type 0, 1, and 3 fonts are documented in the PostScript Language Reference Manual (Second Edition); detailed documentation for Type 1 fonts appears in a separate Adobe book. Type 2 (compressed format) fonts are documented in separate Adobe publications. Type 4 fonts are not documented anywhere; they are essentially Type 1 fonts with a BuildChar or BuildGlyph procedure. Types 9, 10, and 11 (CIDFontType 0, 1, and 2) and Type 32 (downloaded bitmap) fonts are documented in Adobe supplements. Type 42 (encapsulated TrueType) fonts are documented in an Adobe supplement; the TrueType format is documented in publications available from Apple and Microsoft. Ghostscript does not support Type 14 (Chameleon) fonts, which use a proprietary Adobe format.
If you create your own fonts and will use them only within your own
organization, you should use
UniqueID values between
4000000 and 4999999.
If you plan to distribute fonts, ask Adobe to assign you some UniqueIDs and
XUID for your organization. Contact
Unique ID Coordinator
Adobe Developers Association
Adobe Systems, Inc.
345 Park Avenue
San Jose, CA 95110-2704
+1-408-536-9000 telephone (ADA)
The XUID is a Level 2 PostScript feature that serves the same function as
the UniqueID, but is not limited to a single 24-bit integer. The
bdftops program creates XUIDs of the form
[-X- 0 -U-]" where "
-X-" is the
organization XUID and "
-U-" is the UniqueID. (Aladdin
Enterprises' organization XUID, which appears in a few places in various
font-related files distributed with Ghostscript, is 107; do not use this for
your own fonts that you distribute.)
The "Xfonts" feature is no longer supported.
Copyright © 2000-2018 Artifex Software, Inc. All rights reserved.
This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that license. Refer to licensing information at http://www.artifex.com/ or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
Ghostscript version 9.23, 21 March 2018