home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega CD-ROM 1
/
megacd_rom_1.zip
/
megacd_rom_1
/
POSTSCRI
/
GS23A.ZIP
/
FONTS.DOC
< prev
next >
Wrap
Text File
|
1991-05-02
|
8KB
|
182 lines
Copyright (C) 1990, 1991 Aladdin Enterprises. All rights reserved.
Distributed by Free Software Foundation, Inc.
This file is part of Ghostscript.
Ghostscript is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY. No author or distributor accepts responsibility
to anyone for the consequences of using it or for whether it serves any
particular purpose or works at all, unless he says so in writing. Refer
to the Ghostscript General Public License for full details.
Everyone is granted permission to copy, modify and redistribute
Ghostscript, but only under the conditions described in the Ghostscript
General Public License. A copy of this license is supposed to have been
given to you along with Ghostscript so you can know your rights and
responsibilities. It should be in a file named COPYING. Among other
things, the copyright notice and this notice must be preserved on all
copies.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This file, fonts.doc, describes the fonts and font facilities supplied
with Ghostscript.
For an overview of Ghostscript and a list of the documentation files, see
README.
Ghostscript fonts
-----------------
The fonts included with Ghostscript come in several parts:
- Font data in files *.gsf: each file defines one (transformable)
font specified in outline form.
- BuildChar procedures in gs_fonts.ps: these provide the
algorithms for interpreting the data in the .gsf files.
- The Fontmap file: this relates Ghostscript font names to .gsf
file names.
Currently, the fonts supplied with Ghostscript are based on various public
domain bitmap fonts, mostly the ones supplied with the X11 distribution
from MIT, and on the public domain Hershey fonts. The fonts are
distributed in the file `ghostscript-N.NNfonts.tar.Z'. The bitmap-derived
fonts include the usual Helvetica, Times-Roman, and so on; see the file
`Fontmap' for the complete list, in the usual roman, italic, bold, and
bold italic styles (for the most part). The Hershey fonts, on the other
hand, are quite different from traditional ones; the file `hershey.doc'
describes them in more detail.
There is also a single rather heavy home-grown font called Ugly. This
font is the file `uglyr.gsf' in the Ghostscript source distribution.
The file gs_fonts.ps, which is loaded as part of Ghostscript
initialization, arranges to load fonts on demand using the information
from Fontmap. If you want to preload all of the known fonts, invoke the
procedure
loadallfonts
This is not done by default, since the fonts occupy about 50K each and there
are a lot of them.
Ghostscript fonts are actually ordinary Ghostscript programs: they use the
extension .gsf instead of .ps simply to be informative. This convention
is only embodied in the Fontmap file: there is no code that knows about
it.
If you want to try out the fonts, prfont.ps contains code for printing a
sampler. Load this program, by including it in the gs command line or by
invoking
(prfont.ps) run
and then to produce a sampler of a particular font, invoke
/fontName DoFont
e.g.
/Times-Roman DoFont
Contents of fonts
-----------------
A Ghostscript font is a dictionary with a standard set of keys as follows.
The keys marked with a * have the same meanings as in P*stScr*pt fonts;
those marked with # have the same meanings as in Adobe Type 1 fonts. Note
that FontName is required; StrokeWidth is required for all stroked or
outlined fonts; and Metrics is not currently supported.
* - FontMatrix <array>: the transformation from character
coordinates to user coordinates.
* - FontType <integer>: the type of the font, either 1 or 3.
* - FontBBox <array>: the bounding box of the font.
* - Encoding <array>: the map from character codes to character
names.
* - FontName <name>: the name of the font.
* - PaintType <integer>: an indication of how to interpret the
character description from CharInfo.
* - StrokeWidth <number>: the stroke width for outline fonts.
* - FontInfo <dictionary>: additional information about the font
(optional, not used by the standard Ghostscript software).
* - UniqueID <integer>: a unique number identifying the font.
* - BuildChar <procedure>: the procedure for showing a character
(not required in type 1 fonts).
# - CharStrings <dictionary>: the map from character names to character
descriptions (relevant only in type 1 fonts).
# - Private <dictionary>: additional information used by the
algorithms for rendering outlines fonts (relevant only in type 1
fonts).
The format of values in the CharStrings and Private dictionaries are
described in the Adobe Type 1 Font Format book.
Adding your own fonts
---------------------
The program bdftops.ps (and invoking shell script bdftops.bat or bdftops)
converts these bitmap files to Ghostscript input, using the Ghostscript
``type1imagepath'' operator to convert the bitmaps into outlines.
If you want to add fonts of your own, you need to do two things. First,
edit Fontmap to include an entry for your new font at the end. The format
for entries is documented in the Fontmap file. Second, you need to
prepare the .gsf file. If you are converting a file from BDF format, the
Ghostscript distribution already includes a program for doing this: run
the shell command
bdftops <bdf_file_name> <your_gsf_file_name>
e.g.,
bdftops /wherever_X_fonts_live/zapfR24.bdf pzdr.gsf
The output file must be in the current directory, and must match the name
in the Fontmap file. After doing the conversion, you can move the
resulting .gsf file to wherever you like.
There is a similar utility to convert files from .PFB form to plain text
.gsf form. Run the shell command
pfbtops <.PFB_file_name> <gsf_file_name>
e.g.,
pfbtops timesrmn.pfb ptmr.gsf
Outstanding problems and questions
----------------------------------
- At large magnifications the characters look lumpy, and the
100x100 dpi fonts don't help that. What we need is some way to
refine the fonts. I can think of several ways to approach it.
First, we could take these fonts, render them at a large scale
(say, 360), capture the bitmaps, clean up the bitmaps by hand,
then convert them back. Second, we could add a smoothing
algorithm to type1imagepath. Third, we could expand the charpath
data, edit the paths, then compress the paths back to charpath's.
None of these is very exciting.
Since Ghostscript uses the Adobe Type 1 format for fonts, there are lots
of opportunities for improvement. Eventually, the right approach is to
use higher-quality fonts, and to implement some of the Type 1 hint
facilities.
Work is underway to create high-quality fonts for Ghostscript in
particular, and the GNU project in general. The fonts distributed with
the current release of Ghostscript have the redeeming value that they are
available *now*.
- Is there a cure for the lightness of some of the fonts (e.g.,
Courier) at small sizes (e.g., 10pt)?
Ghostscript release 2.1 tried to compensate for this, and wound up making
all fonts look too dark and bold. Release 2.2 uses a different
compensation method, which still produces too-light characters, but not as
bad as in 2.0. This is an area in which Ghostscript will probably improve
rather slowly over time.