summaryrefslogtreecommitdiff
path: root/gs/doc/Fonts.htm
blob: 53ec45b6c017096a3bbc379d74d2fe7c1c75348b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Fonts and font facilities supplied with Ghostscript</title>
<!-- $Id$ -->
<!-- Originally: fonts.txt -->
<link rel="stylesheet" type="text/css" href="gs.css" title="Ghostscript Style">
</head>

<body>
<!-- [1.0 begin visible header] ============================================ -->

<!-- [1.1 begin headline] ================================================== -->

<h1>Fonts and font facilities supplied with Ghostscript</h1>

<!-- [1.1 end headline] ==================================================== -->

<!-- [1.2 begin table of contents] ========================================= -->

<h2>Table of contents</h2>

<blockquote><ul>
<li><a href="#About">About Ghostscript fonts</a>
<li><a href="#Free_fonts">Ghostscript's free fonts</a>
<li><a href="#Other_fonts">Other free fonts</a>
<ul>
<li><a href="#Computer_Modern">Computer Modern Fontmap</a>
<li><a href="#Chinese">Free Chinese (Hanzi) fonts</a>
<li><a href="#Japanese">Free Japanese (Kanji) fonts</a>
<li><a href="#Unicode_CMaps">Unicode CMaps</a>
<li><a href="#Cyrillic">Free Cyrillic fonts</a>
<li><a href="#Partial_Unicode_fonts">(Partial) Unicode fonts</a>
</ul>
<li><a href="#Get_fonts">How Ghostscript gets fonts when it runs</a>
<li><a href="#Platform_fonts">Platform fonts</a>
<li><a href="#Add_fonts">Adding your own fonts</a>
<ul>
<li><a href="#Convert_BDF">Converting BDF fonts</a>
</ul>
<li><a href="#For_developers">For developers only</a>
<li><a href="#Use_gs_fonts_with_X">Using Ghostscript fonts on X Windows displays</a>
<ul>
<li><a href="#Using_xset">Using <code>xset</code></a>
<li><a href="#Font_permanent_installation">Permanent installation</a>
<ul>
<li><a href="#Configure_xfs">Configuring the <code>xfs</code> font server</a>
<li><a href="#Configure_Xfree86">Xfree86 display servers</a>
</ul>
</ul>
</ul></blockquote>

<!-- [1.2 end table of contents] =========================================== -->

<!-- [1.3 begin hint] ====================================================== -->

<p>For other information, see the <a href="Readme.htm">Ghostscript
overview</a>.

<!-- [1.3 end hint] ======================================================== -->

<hr>

<!-- [1.0 end visible header] ============================================== -->

<!-- [2.0 begin contents] ================================================== -->

<h2><a name="About"></a>About Ghostscript fonts</h2>

<p>
Ghostscript is distributed with two kinds of files related to fonts:

<ul>
<li>the fonts themselves in individual files, and
<li>a file "<code>Fontmap</code>" that defines for
Ghostscript which file represents which font.
</ul>

<p>
Additionally, a file <code>cidfmap</code> can be used
to create CID fonts for CJK font files on the system See
the section on <a href="Use.htm#CIDFontSubstitution">CID Font Substitution</a>
for details.

<p>
Most of the font files supplied with Ghostscript have the extension
<code>.pfb</code>, and a few have <tt><b>.pfa</b></tt> or
<code>.gsf</code>.  Each file defines one ordinary PostScript Type 1
outline font which any PostScript language interpreter can use.  Files with
<code>.pfa</code> or <tt><b>.pfb</b></tt> extensions are also compatible
with Adobe Type Manager (ATM) and with tools that don't include a full
PostScript language interpreter; files with <code>.gsf</code> extension
are incompatible with ATM and other tools. Ghostscript compiled with the
"ttfont" option can also use TrueType fonts with the extension
<code>.ttf</code>.

<p><a name="Fontmap"></a>
When Ghostscript needs a font, it must have some way to know where to look
for it: that's the purpose of the <code>Fontmap</code> file, which
associates the names of <em>fonts</em> such as <code>/Times-Roman</code>
with the names of font <em>files</em>, such as
<code>n021003l.pfb</code>.  <code>Fontmap</code> can also create
aliases for font names, so that for instance,
<code>/NimbusNo9L-Regu</code> means the same font as
<code>/Times-Roman</code>.

<hr>

<h2><a name="Free_fonts"></a>Ghostscript's free fonts</h2>

<p>
Two sets of free fonts are supplied for Ghostscript:

<ul>
<li>35 commercial-quality Type 1 basic PostScript fonts -- Times,
Helvetica, Courier, Symbol, etc. -- contributed by URW++ Design and
Development Incorporated, of Hamburg, Germany
(<a href="http://www.urwpp.de/">http://www.urwpp.de/</a>).  Fontmap names
them all.

<li>A miscellaneous set including Cyrillic, kana, and fonts derived from
the free Hershey fonts, with improvements (such as adding accented
characters) by Thomas Wolff.  The Hershey-based fonts are quite different
from traditional printer or display fonts; you can read about them in more
detail in the <a href="Hershey.htm">documentation on Hershey fonts</a>.

</ul>

<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=7 bgcolor="#CCCC00"><hr><font size="+1">Font packages</font><hr>
<tr>	<td><b>System</b>
	<td>&nbsp;&nbsp;
	<td><b>File name</b>
	<td>&nbsp;&nbsp;
	<td><b>Contents</b>
	<td>&nbsp;&nbsp;
	<td><b>Types</b>
<tr>	<td colspan=7><hr>
<tr valign=top>	<td>DOS and<br>MS Windows
	<td>&nbsp;
	<td><code>gs###fn1.zip</code>
	<td>&nbsp;
	<td>Basic
	<td>&nbsp;
	<td><code>.pfb</code>
<tr valign=top>	<td>&nbsp;
	<td>&nbsp;
	<td><code>gs###fn2.zip</code>
	<td>&nbsp;
	<td>Miscellaneous
	<td>&nbsp;
	<td>Various, for<br>different fonts
<tr>	<td colspan=7><hr>
<tr valign=top>	<td>Unix
	<td>&nbsp;
	<td><code>ghostscript-fonts-std-#.##.tar.gz</code>
	<td>&nbsp;
	<td>Basic
	<td>&nbsp;
	<td><code>.afm</code>,
	    <code>.pfb</code>,<br><b><tt>.pfm</tt></b> <tr valign=top> <td>&nbsp;
	<td>&nbsp;
	<td><code>ghostscript-fonts-other-#.##.tar.gz</code>
	<td>&nbsp;
	<td>Miscellaneous
	<td>&nbsp;
	<td><code>.afm</code>,
	    <code>.gsf</code>,<br><b><tt>.pfa</tt></b>, <b><tt>.pfm</tt></b>

</table>
</blockquote>

<p>
"#.##" and "###" are the version number with and without punctuation.
Fonts can be found at

<blockquote>
<a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/fonts/" 
class="offsite">ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/fonts/</a> (for
several versions; generally the latest is preferred)
</blockquote>

<hr>

<h2><a name="Other_fonts"></a>Other free fonts</h2>

<h3><a name="Computer_Modern"></a>Computer Modern Fontmap</h3>

<p>
Don Knuth's Computer Modern fonts are popular, free, and widely available.
A Fontmap appropriate for these fonts is available from:

<blockquote>
<a
href="ftp://tug.ctan.org/tex-archive/fonts/cm/ps-type1/contrib/Fontmap.cmr" 
class="offsite">
ftp://tug.ctan.org/tex-archive/fonts/cm/ps-type1/contrib/Fontmap.cmr</a>
</blockquote>

<p>
or from other <a href="http://www.ctan.org/" class="offsite">CTAN</a> sites.

<h3><a name="Chinese"></a>Free Chinese (Hanzi) fonts</h3>

<p>
A free Chinese font, originally provided by courtesy of Jackson Technology,
Ltd., Taiwan under the GPL and now distributed by the Taiwan NeXT User
Group, is available from:

<blockquote>
<a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/3rdparty/fonts/hanzi/" 
class="offsite">ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/3rdparty/fonts/hanzi/</a>
</blockquote>

<p>
Prof. Wu of the Department of Economics of National Taiwan University has
created several free Type 1 Chinese fonts designed to be used with TeX.  His
e-mail is <a
href="mailto:ntut019@ccms.ntu.edu.tw">ntut019@ccms.ntu.edu.tw</a>.  The
fonts are available from

<blockquote>
<a href="ftp://cle.linux.org.tw/pub/fonts/cwfont/" 
class="offsite">ftp://cle.linux.org.tw/pub/fonts/cwfont/</a><br>
</blockquote>

<p>
Arphic Technology Co., Ltd., has made several free TrueType Chinese fonts
available under the Arphic Public License, a license very similar to the
GPL.  (Ghostscript can use TrueType fonts if Ghostscript is compiled with
the <code>ttfont</code> feature included: see <a
href="Make.htm#Features_and_devices">here</a> for more information.)  The
fonts and license are available from

<blockquote>
<a href="ftp://cle.linux.org.tw/pub/fonts/arphic/" 
class="offsite">ftp://cle.linux.org.tw/pub/fonts/arphic/</a><br>
</blockquote>

<h3><a name="Japanese"></a>Free Japanese (Kanji) fonts</h3>

<p>
Mr. Tetsurou Tanaka of the Department of Engineering, University of Tokyo,
has created a set of free Kanji fonts available from

<blockquote>
<a href="ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/" 
class="offsite">ftp://ftp.ipl.t.u-tokyo.ac.jp/Font/</a><br>
</blockquote>

<p>
along with documentation in Japanese and English describing their
conditions of use and how to use them.  An older copy of these fonts, under
somewhat different names, is available at the Ghostscript site:

<blockquote>
<a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/3rdparty/fonts/kanji/">
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/3rdparty/fonts/kanji/</a><br>
</blockquote>

<p>
Mr. Norio Katayama has done some work to make Ghostscript work well with
Kanji fonts.  An easy-to-install Kanji font for Ghostscript, with
installation instructions, is at

<blockquote>
<a href="http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-ttf.html" 
class="offsite">http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-ttf.html</a>
</blockquote>

<p>
The same site has patches to make Ghostscript work with Japanese VF fonts,
with documentation in both English and Japanese:

<blockquote>
<a href="http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-vflib.html" 
class="offsite">http://www.cit.ics.saitama-u.ac.jp/~far/howto/gs-vflib.html</a>
</blockquote>

<p>
Here are some other resources in Japanese relating to VFlib and using
Ghostscript with Japanese fonts:

<blockquote><dl compact>
<dt><a href="http://kakugawa.aial.hiroshima-u.ac.jp/~kakugawa/Hacks/" 
class="offsite">http://kakugawa.aial.hiroshima-u.ac.jp/~kakugawa/Hacks/</a>
<dt><a href="http://itohws03.ee.noda.sut.ac.jp/~matsuda/VFlib-FT/" 
class="offsite">http://itohws03.ee.noda.sut.ac.jp/~matsuda/VFlib-FT/</a>
<dd>Author &lt;<a href="mailto:matsuda@itohws01.ee.noda.sut.ac.jp">matsuda@itohws01.ee.noda.sut.ac.jp</a>&gt;
<dt><a href="http://www.rd.nacsis.ac.jp/~katayama/homepage/ghostscript/Japanese.html"
class="offsite">http://www.rd.nacsis.ac.jp/~katayama/homepage/ghostscript/Japanese.html</a>
<dd>Author &lt;<a href="mailto:katayama@rd.nacsis.ac.jp">katayama@rd.nacsis.ac.jp</a>&gt;
</dl></blockquote>

<h3><a name="Unicode_CMaps"></a>Unicode CMaps</h3>

<p>
Some Unicode CMaps that can be used with Ghostscript are freely downloadable from

<blockquote>
<a href="ftp://ftp.oreilly.com/pub/examples/nutshell/ujip/adobe/" 
class="offsite">ftp://ftp.oreilly.com/pub/examples/nutshell/ujip/adobe/</a>
</blockquote>

<h3><a name="Cyrillic"></a>Free Cyrillic fonts</h3>

<p>
N. Glonty and A. Samarin created in 1989 a Cyrillic extension of TeX's
"Computer Modern" fonts, now freely available through the
<a href="http://www.ctan.org/" class="offsite">Comprehensive TeX Archive Network</a> (CTAN),
for instance at

<blockquote>
<a href="ftp://ctan.tug.org/tex-archive/fonts/cyrillic/cmcyr/" 
class="offsite">ftp://ctan.tug.org/tex-archive/fonts/cyrillic/cmcyr/</a>
</blockquote>

<p>
<a href="http://www.ctan.org/" class="offsite">CTAN's</a> entire collection of Cyrillic fonts
is, for instance, at

<blockquote>
<a href="ftp://ctan.tug.org/tex-archive/fonts/cyrillic/" 
class="offsite">ftp://ctan.tug.org/tex-archive/fonts/cyrillic/</a>
</blockquote>

<p>
Basil K. Malyshev created the "Paradissa Fonts Collection" in 1993.  It
contained 165 fonts, including the Glonty and Samarin font above plus other
Computer Modern, Euler, and LaTeX fonts, all in PostScript Type 1 format
with <code>.afm</code> and <code>.pfm</code> files, compatible with ATM.
The collection could once be found through CTAN, for instance at

<blockquote>
http://www.ctan.org/tex-archive/fonts/
<!-- orginal was ftp://ctan.tug.org/tex-archive/fonts/postscript/cm/ -->
</blockquote>

<p>
but the collection no longer seems to be available. However, the
<a href="http://www.ctan.org/tex-archive/fonts/" class="offsite">ctan fonts directory</a>
remains an excellent source of free fonts, many of which are offered in
postscript as well we as TeX Metafont format.

<hr>

<h3><a name="Partial_Unicode_fonts"></a>(Partial) Unicode fonts</h3>

<p>
George W. Wilson is distributing some free partial Unicode fonts he created.
These fonts currently lack Arabic and CJK characters, but they include a
very large subset of the remaining Unicode set.  They are available in both
Type 1 and TrueType formats.  See

<blockquote>
<a href="http://bibliofile.mc.duke.edu/gww/fonts/Unicode.html" 
class="offsite">http://bibliofile.mc.duke.edu/gww/fonts/Unicode.html</a>
</blockquote>

<h2><a name="Get_fonts"></a>How Ghostscript gets fonts when it runs</h2>

<p>
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 <code>gs_fonts.ps</code>, which arranges to load
fonts on demand using information from the font map.  To preload all of the
known fonts, invoke the procedure

<blockquote><code>
loadallfonts
</code></blockquote>

<p>
The file <code>prfont.ps</code> contains code to print a sample page of
a font.  Load this program by including it in the <code>gs</code>
command line or by invoking

<blockquote><code>
(prfont.ps) run
</code></blockquote>

<p>
Then to produce a sampler of a particular font XYZ, invoke

<blockquote><code>
/XYZ DoFont
</code></blockquote>

<p>For example,

<blockquote><code>
/Times-Roman DoFont
</code></blockquote>

<p>
For more information about how Ghostscript loads fonts during execution,
see <a href="Use.htm#Font_lookup">here</a>.

<hr>

<h2><a name="Platform_fonts"></a>Platform fonts</h2>

<p>
Ghostscript displays text on screen using whatever font technology is
provided by the system on which it runs, by calling the system's API to
display text.  On platforms with X Windows, this is X Windows; on MS
Windows it may be TrueType or ATM; Ghostscript neither knows nor cares.

<p>
The PostScript language specifies that fonts are data structures with
particular contents (for instance, they include a bounding box for the
font, an Encoding vector to specify the character set, etc.), and it is
common for PostScript files to use this fact; also, characters can be used
as clipping regions, and can be arbitrarily algorithmically rotated,
skewed, expanded or condensed, etc. Most of this information is available
in some form from the underlying graphics system, but one crucial piece is
not: the actual scalable outlines of the characters, which Ghostscript
needs in order to implement both clipping with character shapes and
arbitrarily transformed characters.  Consequently

<blockquote>
Ghostscript needs the scalable outlines of any font mentioned in a
document, and loads them from the disk (<code>.pfa</code>,
<code>.pfb</code>, or <tt><b>.gsf</b></tt>
file) in the usual way, even if it uses the platform's font machinery to
display the characters. In other words, Ghostscript must still be able to
find its font files.
</blockquote>

<p>
To make matters worse, platforms use different names for their standard
fonts.  For example, the Times Roman font, for which PostScript files use
the name "<code>Times-Roman</code>", may be known as
"<code>Times-Roman</code>", "<b><tt>Times&nbsp;Roman</tt></b>",
"<code>Tms&nbsp;Rmn</code>",
"<code>Times&nbsp;New&nbsp;Roman</code>", or
"<code>TimesNewRoman</code>".  The name may even be completely
different: the usual Helvetica-equivalent TrueType font is called
"<code>Arial</code>".  It is possible to deal with this situation by
introducing aliases in Fontmap, but there are two reasons why Ghostscript
does not currently do this:

<ol>
<li>Methods of naming in different systems are so unstandardized that there
seems to be no small set of alternative names likely to cover most
situations.  All five of the names above for Times Roman have been seen
under Windows and OS/2, depending on the version of the system, whether it
uses TrueType or ATM, and other unknown factors.

<li>Each alias takes up space at run time.  If each of the standard fonts
has three additional aliases, this might amount to 50KB of wasted space,
which may be a lot on some smaller systems.
</ol>

<p>
If you don't seem to be getting nice characters on the screen under MS
Windows, you can try adding aliases to Fontmap, according to the
documentation you'll find in there.

<hr>

<h2><a name="Add_fonts"></a>Adding your own fonts</h2>

<p>
Ghostscript can use any Type 0, 1, 3, 4, or 42 font acceptable to
other PostScript language interpreters or to ATM, including MultiMaster
fonts.  Beginning with release 4.0, Ghostscript can also use TrueType fonts
if it was compiled with the "ttfont" option.

<p>
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.

<p>
In the PC world, Type 1 fonts are customarily given names ending in
<code>.PFA</code> or <tt><b>.PFB</b></tt>.  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.

<h3><a name="Convert_BDF"></a>Converting BDF fonts</h3>

<p>
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
<code>bdftops</code> (Unix) or the command file
<code>bdftops.bat</code> (DOS) converts a BDF file to a
scalable outline using <code>bdftops.ps</code> .  Run the
shell command

<blockquote><code>
bdftops&nbsp;BDF_filename&nbsp;[AFM_file1_name&nbsp;...]&nbsp;gsf_filename&nbsp;fontname<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UniqueID&nbsp;[XUID]&nbsp;[encodingname]
</code></blockquote>

<p>
The arguments have these meanings:
<blockquote><table cellpadding=0 cellspacing=0>
<tr valign=top>	<td><code>BDF_filename</code>
	<td>&nbsp;&nbsp;
	<td>Input bitmap file in BDF format
	<td>&nbsp;&nbsp;
	<td>&nbsp;
<tr valign=top>	<td><code>AFM_file1_name</code>
	<td>&nbsp;
	<td>AFM files giving metrics
	<td>&nbsp;
	<td>(Optional)
<tr valign=top>	<td><code>gsf_filename</code>
	<td>&nbsp;
	<td>Output file
	<td>&nbsp;
	<td>&nbsp;
<tr valign=top>	<td><code>fontname</code>
	<td>&nbsp;
	<td>Name of the font
	<td>&nbsp;
	<td>&nbsp;
<tr valign=top>	<td><code>UniqueID</code>
	<td>&nbsp;
	<td>UniqueID (<a href="#Unique_IDs">as described below</a>)
	<td>&nbsp;
	<td>&nbsp;
<tr valign=top>	<td><code>XUID</code>
	<td>&nbsp;
	<td>XUID, in the form <code>n1.n2.n3...</code> (<a href="#Unique_IDs">as described below</a>)
	<td>&nbsp;
	<td>(Optional)
<tr valign=top>	<td><code>encodingname</code>
	<td>&nbsp;
	<td>"StandardEncoding" (the default), "ISOLatin1Encoding",<br>"SymbolEncoding", "DingbatsEncoding"
	<td>&nbsp;
	<td>(Optional)
</table></blockquote>

<p>
For instance

<blockquote><code>
bdftops&nbsp;pzdr.bdf&nbsp;ZapfDingbats.afm&nbsp;pzdr.gsf&nbsp;ZapfDingbats&nbsp;4100000&nbsp;1000000.1.41
</code></blockquote>

<p>
Then make an entry in Fontmap for the <code>.gsf</code>
file (<code>pzdr.gsf</code> in the example) as
<a href="#Add_fonts">described above</a>.

<hr>

<h2><a name="For_developers"></a>For developers only</h2>

<p>
The rest of this document is very unlikely to be of value to ordinary
users.

<h3><a name="Font_contents"></a>Contents of fonts</h3>

<p>
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.

<h3><a name="Unique_IDs"></a>Font names and unique IDs</h3>

<p>
If you create your own fonts and will use them only within your own
organization, you should use <code>UniqueID</code> values between
4000000 and 4999999.

<p>
If you plan to distribute fonts, ask Adobe to assign you some UniqueIDs and
also an <code>XUID</code> for your organization. Contact

<blockquote><address>
Unique ID Coordinator<br>
Adobe Developers Association<br>
Adobe Systems, Inc.<br>
345 Park Avenue<br>
San Jose, CA  95110-2704<br>
+1-408-536-9000 telephone (ADA)<br>
+1-408-536-6883 fax<br>
<a href="mailto:fontdev-person@adobe.com">fontdev-person@adobe.com</a><br>
</address></blockquote>

<p>
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
<code>bdftops</code> program creates XUIDs of the form
"<code>[-X-&nbsp;0&nbsp;-U-]</code>" where "<tt><b>-X-</b></tt>" is the
organization XUID and "<code>-U-</code>" 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.)

<hr>

<h2><a name="Use_gs_fonts_with_X"></a>Using Ghostscript fonts on X Windows displays</h2>

<p>
The standard X11 distribution can display various kinds of fonts, including
the Adobe Type 1 format, so font files distributed with Ghostscript can be
used on X Windows displays.  Beginning with Ghostscript version 6.0, the
font archive contains the directory files needed to map Ghostscript's font
files to XLFDs.  Those files are named "<code>fonts.dir</code>" and
"<code>fonts.scale</code>".  There are two main methods to configure
your display to use these files.

<ul>
<li><a href="#Using_xset">With <code>xset</code></a> any user can add a
new directory to the font search path for the duration of a session.
<li>An administrator with root access can <a
href="#Font_permanent_installation">add the Ghostscript font directory
permanently</a> to the <a href="#X_font_catalog">X font server's
catalog</a> or to an <a href="#Xfree86_fontpath">X display server's list of
directories</a>.
</ul>

<h3><a name="Using_xset"></a>Using <code>xset</code></h3>

<p>
Users without root access can add the Ghostscript font directories to the
font search path using <code>xset</code>. Such a setting is transient
and must be repeated each time the display server is reset or restarted,
typically at login, so the call to <code>xset</code> should be added to
the user's "<code>.xsession</code>" or "<b><tt>.xinitrc</tt></b>"
startup script to make the fonts available at each login.

<p>
To add a new font directory, invoke <code>xset</code> like this:

<blockquote>
<code>xset fp+ <em>{directory}</em></code>
</blockquote>

<p>
where <b><em>{directory}</em></b> is the full pathname to the directory
containing the fonts on the host running the X display server.  For common
Ghostscript installations the path is

<blockquote>
<code>/usr/local/Ghostscript/share/fonts</code>
</blockquote>

<h3><a name="Font_permanent_installation"></a>Permanent installation</h3>

<p> A system administrator, or anyone with the necessary root privilege,
can make Ghostscript's fonts permanently available to the managed X display
servers.  This setup depends on the servers and the methods used
to make the fonts available.

<h4><a name="Configure_xfs"></a>Configuring the <code>xfs</code> font server</h4>

<p>
An X display server can obtain its font resources from a dedicated X font
server.  <code>xfs</code> is a prototype font server included in the X
Consortium X11 distribution.  It is configured with a file located in a
directory whose exact location is installation-dependent and could be any
of

<blockquote><code>
/usr/lib/X11/fs/config
<br>/usr/X11/lib/X11/fs/config
<br>/usr/X11R6/lib/X11/fs/config
</code></blockquote>

<p>
or some similar name. You can also use <code>xfs</code>'s
"<code>-config</code>" command-line option to specify the location of
the configuration file.

<p><a name="X_font_catalog"></a>
The configuration file designates a list ("catalog") of directories, each
of which contains fonts and a font mapping database (the file
"<code>fonts.dir</code>").  This list is specified with the
"<code>catalogue=</code>" keyword followed by a list of absolute
directory paths separated by commas.  To add the Ghostscript directory,
include its full name in the catalog list, for example:

<blockquote><code>
catalogue&nbsp;=&nbsp;/usr/local/share/Ghostscript/fonts/,
<br>/usr/X11R6/lib/X11/fonts/misc/,
<br>/usr/X11R6/lib/X11/fonts/Speedo/,
<br>/usr/X11R6/lib/X11/fonts/Type1/,
<br>/usr/X11R6/lib/X11/fonts/75dpi/,
<br>/usr/X11R6/lib/X11/fonts/100dpi/
</code></blockquote>

<p>
The fonts are searched in the order the directories are specified, so an
XLFD mapped by the Ghostscript directory could shadow a previous similar
description specified in the following directories.  Once the file is
modified, instruct the font server to reload the configuration file by
sending it the USR1 signal:

<blockquote>
<code>kill -HUP <em>{pid}</em></code>
</blockquote>

<p>
where <code><em>{pid}</em></code> is the font server process's numeric 
process
ID, as obtained with the "<code>ps</code>" command. Be sure to check
that the server is still alive after signaling it: it is very picky and
could decide to shut itself down if something is wrong in the new
configuration. If this happens, restart the server by hand and try to
figure out from its output what's happening. If the font server dies,
display servers using it will experience problems, so be sure to send the
signal from the console or from a display not using that font server!

<h4><a name="Configure_Xfree86"></a>Xfree86 display servers</h4>

<p><a name="Xfree86_fontpath"></a>
With the family of Xfree86 display servers, adding a new font directory
permanently requires editing the "<code>/etc/XF86Config</code>" setup
file to add a new "<code>FontPath</code>" to the "<b><tt>Files</tt></b>"
section:

<blockquote>
<code>Section "Files"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RgbPath&nbsp;&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/rgb"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/local/share/Ghostscript/fonts"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/fonts/misc:unscaled"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/fonts/Type1"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FontPath&nbsp;&nbsp;&nbsp;"/usr/X11R6/lib/X11/fonts/Speedo"
<br>EndSection</code>
</blockquote>

<p>
The fonts are searched in the order the directories are specified, so an
XLFD mapped by the Ghostscript directory could shadow a previous similar
description specified in the following directories.  Once this global
configuration is edited, the new fonts become available to all Xfree86
servers in use on that host. If a server is running, it must be restarted
to take effect: just quit the current session in the usual way.  If the
server is under the control of <code>xdm</code>, you may have to kill
it, because it is usually reset only between successive sessions.

<p>
This section by Bertrand Petit
&lt;<a href="mailto:eegs@phoe.frmug.org">eegs@phoe.frmug.org</a>&gt;

<!-- [2.0 end contents] ==================================================== -->

<!-- [3.0 begin visible trailer] =========================================== -->
<hr>

<p>
<small>Copyright &copy; 2000-2006 Artifex Software, Inc.  All rights reserved.</small>

<p>
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.,  7 Mt. Lassen Drive - Suite A-134,
San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.

<p>
<small>Ghostscript version 8.64, 2 February 2009

<!-- [3.0 end visible trailer] ============================================= -->

</small></body>
</html>