📄 fonts.txt
字号:
compiler in a 16-bit environment.) Fonts that have been precompiled and
linked in this way do not need to appear in the Fontmap, although if they do
appear there, no harm is done.
The utility for precompiling fonts is called font2c. Note that font2c is
a PostScript language program, so you must have Ghostscript already
running to be able to run font2c; you must also have entries in the
Fontmap for the fonts you want to compile. For example, to precompile
the Times-Italic font,
font2c Times-Italic ptmri.c
where the first argument is the font name and the second is the name of
the .c file. You can use any file name you want, as long as it ends in
.c. It doesn't have to be limited to 8 characters, unless your operating
system requires this. We suggest that you use names xxxx.c, where
xxxx.gsf or xxxx.pfa is the name of the font file in the Fontmap file,
just so you don't have to keep track of another set of names. (If you are
running on a VMS platform, or another platform where the C compiler has a
limit on the length of identifiers, you must do something slightly more
complicated; see the section 'Platforms with identifier length limits'
below. Also, on VMS, you must put quotes "" around the font name so that
the VMS command processor doesn't convert the name to lower case.)
For VMS environments, see the directions in the file make.txt, and ignore
the rest of this section.
Note that ncrr.c, ptmr.c, etc. are not supplied with the Ghostscript
fileset, since they are quite large and can easily be recreated using the
font2c program as described above. There is a makefile called cfonts.mak
that will run font2c on all the fonts supplied with Ghostscript. Invoke it
with
make -f cfonts.mak
On some systems, you may have to omit the space following the -f, i.e.,
make -fcfonts.mak
Besides running font2c, you must arrange things so that the fonts will be
compiled, and linked into the executable. To do this, add the compiled
fonts "feature" to your platform-specific makefile. On MS-DOS systems, you
edit tc.mak, bc.mak, bcwin.mak, msc.mak, or watc.mak; on Unix systems, you
edit ansihead.mak, cc-head.mak, or gcc-head.mak, and then execute tar_cat.
Find the definition of the FEATURE_DEVS macro in the makefile, e.g.,
FEATURE_DEVS=level2.dev pdf.dev
and add ccfonts.dev, e.g.,
FEATURE_DEVS=level2.dev pdf.dev ccfonts.dev
Next, you must add the specific fonts to the generic makefile. On MS-DOS
systems, you edit gs.mak; on Unix systems, you edit makefile. The makefile
already has rules for the standard 35 fonts supplied with Ghostscript.
Find the line in the relevant makefile that says
#ccfonts1_=<something>
Remove the # mark from this line, and from all the following lines down to
and including the one that says
#ccfonts9=<something>
This is all you need to do for the standard fonts. The next couple of
paragraphs describe how to compile in other fonts, such as the Utopia or
Kana fonts or your own fonts.
Suppose you want to compile the Kana fonts into the executable. First,
pick one of ccfonts10 through 15 as the place you will do this, say
ccfonts10. Add your compiled font file names, e.g.,
ccfonts10_=fhirw.$(OBJ)
If the line gets too long, use another line of the same form, e.g.,
ccfonts11_=fkarw.$(OBJ)
Just below this, you will find a line that says
ccfonts10_=
Add your own fonts to the end of this line, e.g.,
ccfonts10=Calligraphic_Hiragana
Notice that you must replace `-' by `_' in the font name. Again, if
the line gets too long, add another line of the same form, e.g.,
ccfonts10=Calligraphic_Hiragana
ccfonts11=Calligraphic_Katakana
After all the lines of this form, add a pair of lines to compile each font,
separating these entries from the ccfonts* lines and from each other by a
blank line. In our example:
fhirw.$(OBJ): fhirw.c $(CCFONT)
$(CCCF) fhirw.c
fkarw.$(OBJ): fkarw.c $(CCFONT)
$(CCCF) fkarw.c
Finally, run `make'. The executable will now include the fonts you added.
They will be present in FontDirectory when Ghostscript starts up.
Precompiling fonts on platforms with identifier length limits
-------------------------------------------------------------
On some platforms, the C compiler and/or linker have a limit on the number
of significant characters in an identifier. On such platforms, you must
do a little extra work.
Let N be the maximum number of significant characters in an identifier
(typically 31). For each font whose name is longer than N-5 characters,
pick an arbitrary identifier that we will call the "short name". This can
be any string you want, as long as it contains only letters, digits, and
underscores; is no longer than N-5 characters; and is not the same as any
other font name or short name. A good choice for this would be to use the
name of the C file. (There is no harm in doing this for fonts with names
shorter than N-5 characters, it's just not necessary.)
You must do two different things for fonts that require a short name.
First, you must supply the short name as a third argument to the font2c
program. For example, to compile NewCenturySchlbk-BoldItalic using the
short name "pncbi",
font2c NewCenturySchlbk-BoldItalic pncbi.c pncbi
Then when you add the font to the gsaddmod line in the makefile, use the
short name, not the actual font name, e.g.,
ccfonts2=pncbi
instead of
ccfonts2=NewCenturySchlbk_BoldItalic
Everything else is as described above.
This procedure doesn't change the name of the font in the Fontmap, or as
seen from within Ghostscript; it's just a workaround for a limitation of
some older compilers.
Font names and unique IDs
-------------------------
If you create your own fonts, and are only going to use them within your own
organization, you should use UniqueID values between 4000000 and 4999999 as
described just below; if you are going to distribute fonts, call Adobe and
get them to assign you some UniqueIDs and also an XUID for your
organization. The current (September 1993) UniqueID Coordinator is Terry
O'Donnell; he is very helpful and will probably be able to assign you the
numbers over the phone.
The suggested temporary UniqueID for a font looks like:
4TTWVE0
where
TT is a two-digit number representing the typeface,
W represents the weight (normal, bold, ...),
V represents the variant (normal, italic, oblique, ...), and
E represents the expansion (normal, condensed, ...).
This scheme will not work forever. As soon there are more 99 typefaces, or
more than 9 weights or variants, we will have to do something else. But it
suffices for the near future.
XUIDs are a Level 2 PostScript feature that serves the same function as
UniqueIDs, 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 is
107; do not use this for your own fonts that you distribute.)
Ghostscript fonts are stored on files, and the file names must comply
with the 8-character limit imposed by MS-DOS and other operating systems.
We therefore construct the filename for a font in a way somewhat similar to
the construction for temporary UniqueIDs:
FTTWVVVE.gsf
where F is the foundry, TT a two-letter abbreviation for the typeface, and
W, V, and E the weight, variant, and expansion. Since a font can have
multiple variants, we allocate three letters to that (for example, Lucida
Regular Sans Typewriter Italic). If a font has four variants, you're on
your own. If a font does have multiple variants, it's best to add the
expansion letter `r', so that it is clear which letters are variants and
which the expansion.
This scheme is very close to the one proposed in `Filenames for fonts',
published in the first 1990 issue of TUGboat (the journal of the TeX Users
Group).
In the following tables, we made no attempt to be exhaustive. Instead, we
have simply allocated entries for those things that we needed for the fonts
that we are actually distributing.
foundries:
----------
b = Bitstream
f = freely distributable/public domain fonts
n = IBM
p = Adobe (`p' for PostScript)
u = URW[++]
typefaces:
id name filename prefix
----------------------------------------------------------------
08 = Avant Garde = pag (Adobe)
11 = Bookman = pbk (Adobe)
01 = CharterBT = bch (Bitstream)
02 = Courier = ncr (IBM)
03 = Helvetica = phv (Adobe)
04 = New Century Schoolbook = pnc (Adobe)
09 = Palatino = ppl (Adobe)
05 = Symbol = psy (Adobe)
06 = Times = ptm (Adobe)
-- Utopia = put (Adobe)
07 = Zapf Chancery = zc (public domain)
10 = Zapf Dingbats = pzd (Adobe)
12 = public domain Cyrillic = fcy (public domain)
13 = Kevin Hartig Hiragana = fhi (shareware)
14 = Kevin Hartig Katakana = fka (shareware)
90 = Hershey Gothic English = hrge
91 = Hershey Gothic Italian = hrit
92 = Hershey Gothic German = hrgr
93 = Hershey Greek = hrgk
94 = Hershey Plain = hrpl
95 = Hershey Script = hrsc
96 = Hershey Symbol = hrsy
weights:
--------
0 = normal = r
1 = bold = b
2 = book = k
3 = demi = d
4 = light = l
variants:
---------
0 = normal = r (omitted when the weight is normal)
1 = italic = i
2 = oblique = o
3 = script/handwritten/swash = w
expansions:
-----------
0 = normal = r (omitted when the weight and variant
are normal)
1 = narrow = n
Converting BDF fonts to .gsf (Type 1) fonts
-------------------------------------------
The bdftops conversion program takes the following arguments:
bdftops xx.bdf [yy1.afm ...] zz.gsf fontname UniqueID [XUID]
[encodingname]
These arguments have the following meanings:
xx.bdf - the input bitmap file, a BDF file
yy*.afm - the AFM files giving the metrics (optional)
zz.gsf - the output file
fontname - the font name
UniqueID - the UniqueID, as described above
XUID - the XUID, in the form n1.n2.n3... (optional)
encodingname - the encoding for the font (optional)
Currently, the defined encodings are StandardEncoding, ISOLatin1Encoding,
SymbolEncoding, and DingbatsEncoding. If the encoding is omitted,
StandardEncoding is assumed.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -