summaryrefslogtreecommitdiff
path: root/Master/xemtex/doc/ghostscript/Fonts.htm
blob: add24f89d7f9343a7501f04190eaffe7c4652d4e (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
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
<!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: Fonts.htm,v 1.22.2.13.2.6 2003/05/17 14:38:59 giles Exp $ -->
<!-- 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="#CID_Adobe">CJK CID-keyed fonts by Adobe</a>
<li><a href="#CMap_Adobe">Adobe CMaps</a>
<li><a href="#Chinese">Free Chinese (Hanzi) fonts</a>
<li><a href="#Japanese">Free Japanese (Kanji) fonts</a>
<li><a href="#Korean">Free Korean (Hangul and Hanja) fonts</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>
<ul>
<li><a href="#Font_contents">Contents of fonts</a>
<li><a href="#Precompiling">Precompiling fonts</a>
<li><a href="#Short_identifiers">Precompiling fonts on platforms with identifier length limits</a>
<li><a href="#Unique_IDs">Font names and unique IDs</a>
<li><a href="#Codes">Codes used to make font file names</a>
</ul>
<li><a href="#Use_gs_fonts_with_X">Using Ghostscript fonts on X Windows displays</a>
<ul>
<li><a href="#Using_xset">Using <b><tt>xset</tt></b></a>
<li><a href="#Font_permanent_installation">Permanent installation</a>
<ul>
<li><a href="#Configure_xfs">Configuring the <b><tt>xfs</tt></b> 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 "<tt><b>Fontmap</b></tt>" that defines for
Ghostscript which file represents which font.
</ul>

<p>
Most of the font files supplied with Ghostscript have the extension
<tt><b>.pfb</b></tt>, and a few have <tt><b>.pfa</b></tt> or
<tt><b>.gsf</b></tt>.  Each file defines one ordinary PostScript Type 1
outline font which any PostScript language interpreter can use.  Files with
<tt><b>.pfa</b></tt> 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 <tt><b>.gsf</b></tt> extension
are incompatible with ATM and other tools. Ghostscript compiled with the
"ttfont" option can also use TrueType fonts with the extension
<tt><b>.ttf</b></tt>.

<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 <b><tt>Fontmap</tt></b> file, which
associates the names of <em>fonts</em> such as <b><tt>/Times-Roman</tt></b>
with the names of font <em>files</em>, such as
<tt><b>n021003l.pfb</b></tt>.  <b><tt>Fontmap</tt></b> can also create
aliases for font names, so that for instance,
<b><tt>/NimbusNo9L-Regu</tt></b> means the same font as
<b><tt>/Times-Roman</tt></b>.

<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>Unix
	<td>&nbsp;
	<td><b><tt>gnu-gs-fonts-std-#.##.tar.gz</tt></b>
	<td>&nbsp;
	<td>Basic
	<td>&nbsp;
	<td><b><tt>.afm</tt></b>,
	    <b><tt>.pfb</tt></b>,<br><b><tt>.pfm</tt></b> <tr valign=top> <td>&nbsp;
	<td>&nbsp;
	<td><b><tt>gnu-gs-fonts-other-#.##.tar.gz</tt></b>
	<td>&nbsp;
	<td>Miscellaneous
	<td>&nbsp;
	<td><b><tt>.afm</tt></b>,
	    <b><tt>.gsf</tt></b>,<br><b><tt>.pfa</tt></b>, <b><tt>.pfm</tt></b>

</table>
</blockquote>

<p>
"#.##" and "###" are the version number with and without punctuation. The
fonts are not updated every release, so just use the most recent
versions.
Fonts can be found at

<blockquote>
<a href="ftp://ftp.gnu.org/gnu/ghostscript/" 
class="offsite">ftp://ftp.gnu.org/gnu/ghostscript/</a> (and mirrors)<br>
</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="New-user.htm#CTAN">CTAN</a> sites.

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

<p>
A free PostScript font for Traditional Chinese "KaiSu" in
<a href="CJK.htm#About_OCF_fonts">OCF</a> format,
originally provided 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/hanzi/"
class="offsite">
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/hanzi/
</a>
</blockquote>

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

<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.enel.ucalgary.ca/People/far/howto/gs-ttf.html" 
class="offsite">
http://www.enel.ucalgary.ca/People/far/howto/gs-ttf.html
</a>
</blockquote>

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

<blockquote>
<a
href="http://www.enel.ucalgary.ca/People/far/howto/gs-vflib.html" 
class="offsite">
http://www.enel.ucalgary.ca/People/far/howto/gs-vflib.html
</a>
</blockquote>

<p>
Here are some other resources in Japanese relating to VFlib and using
Ghostscript with Japanese OCF 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;
</dl></blockquote>

<h3><a name="Korean"></a>Free Korean (Hangul and Hanja) fonts</h3>

<p>
Hwan Design Inc. created Hangul TrueType fonts (including Hanja)
and released under license similar to BSD.
These fonts can be used as <a href="CJK.htm#About_CID_keyed_fonts">
CID-keyed font</a> via on-the-fly CIDFontType2 conversion. Refer
<a href="CJK.htm">CJK.htm</a>

<blockquote>
<a href="ftp://ftp.mizi.com/pub/baekmuk/"
class="offsite">
ftp://ftp.mizi.com/pub/baekmuk/</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="New-user.htm#CTAN">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>

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

<blockquote><tt><b>
loadallfonts
</b></tt></blockquote>

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

<blockquote><tt><b>
(prfont.ps) run
</b></tt></blockquote>

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

<blockquote><tt><b>
/XYZ DoFont
</b></tt></blockquote>

<p>For example,

<blockquote><tt><b>
/Times-Roman DoFont
</b></tt></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 (<tt><b>.pfa</b></tt>,
<tt><b>.pfb</b></tt>, 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 "<b><tt>Times-Roman</tt></b>", may be known as
"<b><tt>Times-Roman</tt></b>", "<b><tt>Times&nbsp;Roman</tt></b>",
"<b><tt>Tms&nbsp;Rmn</tt></b>",
"<b><tt>Times&nbsp;New&nbsp;Roman</tt></b>", or
"<b><tt>TimesNewRoman</tt></b>".  The name may even be completely
different: the usual Helvetica-equivalent TrueType font is called
"<b><tt>Arial</tt></b>".  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.
In the PC world, Type 1 fonts are customarily given names ending in
<tt><b>.PFA</b></tt> or <tt><b>.PFB</b></tt>.  Ghostscript can use these
directly: you just need to make the entry in Fontmap.
To add CID-keyed fonts, refer <a href="CJK.htm">CJK.htm</a>.

<p>
If you want to use with Ghostscript a commercial fonts
(fonts sold as individual package,
 Type 1 and CID fonts bundled to Adobe products,
 TrueType fonts bundled to Microsoft Windows and Apple Macintosh, etc),
please read carefully the license that accompanies the font to
satisfy yourself that you may do so legally.

The license of bundled fonts are usually quite varied:
browsing-only, printable, and embeddable.
The license of the system and the license of fonts on
the system must be descriminated.
Even if you have officially licensed system,
it does not mean you can use bundled fonts as you want.
In addition to, TrueType and OpenType format have internal
flags to restrict embedding, but, unfortunately,
sometimes they does not reflect the license
correctly.
You have to check the license of EACH fonts which you want to
use with Ghostscript.

We take no responsibility for any possible violations of such licenses.


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

<blockquote><tt><b>
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]
</b></tt></blockquote>

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

<p>
For instance

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

<p>
Then make an entry in Fontmap for the <tt><b>.gsf</b></tt>
file (<tt><b>pzdr.gsf</b></tt> 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="Precompiling"></a>Precompiling fonts</h3>

<p>
You can precompile -- convert -- any Type 1 font into C, then compile and
build it into the Ghostscript executable.  (Type 1 fonts include any font
whose name ends with <tt><b>.pfa</b></tt> or
<tt><b>.pfb</b></tt>, and it also includes all the
Ghostscript <tt><b>.gsf</b></tt> fonts except the Hershey
fonts.)  This has no effect on rendering speed, but it eliminates the time
to load the font dynamically, which may make a big improvement in total
rendering time, especially for multi-page documents.  It also reduces the
number of auxiliary files required at run time.  Fonts precompiled and
built into Ghostscript this way need not appear in Fontmap, although if
they do appear there, no harm is done.

<p><a name="font2c"></a> The utility for precompiling fonts is named
<tt><b>font2c</b></tt>.  Note that since
<tt><b>font2c</b></tt> uses the PostScript language program
<tt><b>font2c.ps</b></tt>, Ghostscript must already be
available to run it, and Fontmap must contain entries for the fonts you
want to compile.  For example, to precompile the Times-Italic font,

<blockquote><tt><b>
font2c Times-Italic ptmri.c
</b></tt></blockquote>

<p>
The first argument ("<b><tt>Times-Italic</tt></b>" above) is the font's
name and the second ("<b><tt>ptmri.c</tt></b>") is the name of the
resulting C file.  You can use any file name you want, as long as it ends
in "<tt><b>.c</b></tt>".  It needn't be limited to eight characters unless
your operating system requires this.  If "<b><tt>XYZ.gsf</tt></b>" or
"<b><tt>XYZ.pfa</tt></b>" is the font file's name in Fontmap,
"<b><tt>XYZ.c</tt></b>" is a good choice for the C file.

<p>
Under VMS, or other systems whose the C compilers limit the length of
identifiers, you must do something slightly more complicated; for that see
the section on <a href="#Short_identifiers">short identifiers in C</a>.  On
VMS also, you must quote the font name ("{font name}") to preserve the
name's mixed upper and lower case.  For VMS environments in general see
<a href="Make.htm#VMS">the VMS directions</a> in the documentation on
building Ghostscript, and ignore the rest of this section.

<p>
Note that fonts are not supplied with Ghostscript in precompiled form, since
those files are quite large and can easily be recreated using <a
href="#font2c"><tt><b>font2c</b></tt></a>.  There is a makefile target to
run <tt><b>font2c</b></tt> on all the fonts supplied with Ghostscript.
Invoke it with

<blockquote><b><tt>
make fonts_standard_c
</tt></b></blockquote>

<p>Besides running <tt><b>font2c</b></tt>, you must compile the fonts and
link them into the executable.  To do this, add the compiled fonts feature
to your platform-specific makefile.  See the
<a href="Make.htm#Makefile_overview">overview of makefiles</a> in the
documentation on building Ghostscript for the list of makefiles for each
platform.  Find the definition of the <tt><b>FEATURE_DEVS</b></tt> macro in
the makefile, which looks something like this:

<blockquote><tt><b>
FEATURE_DEVS=$(PSD)psl3.dev&nbsp;$(PSD)pdf.dev&nbsp;$(PSD)dpsnext.dev&nbsp;$(PSD)pipe.dev
</b></tt></blockquote>

<p>
and add "ccfonts.dev":

<blockquote><tt><b>
FEATURE_DEVS=$(PSD)psl3.dev&nbsp;$(PSD)pdf.dev&nbsp;$(PSD)dpsnext.dev&nbsp;$(PSD)pipe.dev&nbsp;$(PSD)ccfonts.dev
</b></tt></blockquote>

<p>
Next you must add the specific fonts to <tt><b>int.mak</b></tt>, the
platform-independent makefile for the interpreter.  This makefile already
has rules for the standard fonts supplied with Ghostscript, so if you just
want to compile the standard fonts, you needn't do anything else.  Now we
describe how to compile other fonts into the executable, such as the Utopia
or Kana fonts, or your own fonts.

<p>
Suppose you want to compile the Kana fonts into the executable.  First pick
one of <b><tt>ccfonts10</tt></b> through <b><tt>ccfonts15</tt></b> as the
place you will do this, say <b><tt>ccfonts10</tt></b>.  Add your compiled
font file names, for instance

<blockquote><tt><b>
ccfonts10_=$(CFOBJ)fhirw.$(OBJ)
</b></tt></blockquote>

<p>
(Note the underscore "_".) If this makes the line too long, use another
line of the same form, for instance,

<blockquote><tt><b>
ccfonts11_=$(CFOBJ)fkarw.$(OBJ)
</b></tt></blockquote>

<p>
Just below the <b><tt>ccfonts10_=</tt></b> line is a line

<blockquote><tt><b>
ccfonts10=
</b></tt></blockquote>

<p>
(Note no underscore.) Add your own fonts to the end of this line, replacing
dashes ("-") with underscores ("_") in the font names.  For instance:

<blockquote><tt><b>
ccfonts10=Calligraphic_Hiragana
</b></tt></blockquote>

<p>
Again, if a line becomes too long, add another line of the same form, for
instance,

<blockquote><tt><b>
ccfonts10=Calligraphic_Hiragana<br>
ccfonts11=Calligraphic_Katakana
</b></tt></blockquote>

<p>
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 with
a blank line.  In our example this becomes

<blockquote>
<pre>$(CFOBJ)fhirw.$(OBJ): $(CFGEN)fhirw.c $(CCFONT)
	$(CFCC) $(CFO_)fhirw.$(OBJ) $(C_) $(CFGEN)fhirw.c

$(CFOBJ)fkarw.$(OBJ): $(CFGEN)fkarw.c $(CCFONT)
	$(CFCC) $(CFO_)fkarw.$(OBJ) $(C_) $(CFGEN)fkarw.c
</pre></blockquote>

<p>
Finally, run <tt><b>make</b></tt> to build an executable that includes the
fonts you added.  They are present in <b><tt>FontDirectory</tt></b> when
Ghostscript starts up.

<h3><a name="Short_identifiers"></a>Precompiling fonts on platforms with identifier length limits</h3>

<p>
On some platforms the C compiler or linker limits the number of significant
characters usable in an identifier.  On such platforms, you must do a
little extra work.

<p>
Let <em><b>N</b></em> be the maximum number of significant characters in an
identifier (typically 31).  For each font whose name is longer than
<em><b>N</b></em>-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
<em><b>N</b></em>-5 characters; and is different from all other font names
and short names.  A good choice for this is the name of the C file.  There
is no harm in doing this for fonts with names shorter than
<em><b>N</b></em>-5 characters, but it's unnecessary.

<p>
You must do two different things for fonts that require a short name.

<ol>
<li>You must supply the short name as a third argument to
<tt><b>font2c</b></tt>.  For example, to compile
<b><tt>NewCenturySchlbk-BoldItalic</tt></b> using the short name
<b><tt>pncbi</tt></b>,

<blockquote><tt><b>
font2c&nbsp;NewCenturySchlbk-BoldItalic&nbsp;pncbi.c&nbsp;pncbi
</b></tt></blockquote>

<li>
Then when you add the font name to the definition of one of the ccfonts*
macros in the makefile, use the short name, not the actual font name, for
instance,

<blockquote><table cellpadding=0 cellspacing=0>
<tr>	<td>Use
	<td>&nbsp;&nbsp;&nbsp;&nbsp;
	<td><tt><b>ccfonts12=pncbi</b></tt>
<tr>	<td>Rather than
	<td>&nbsp;
	<td><tt><b>ccfonts12=NewCenturySchlbk_BoldItalic</b></tt>
</table></blockquote>
</ol>

<p>
Everything else is as described above.  This procedure doesn't change the
name of the font in Fontmap or as seen from within Ghostscript; it just
works around a limitation of some older compilers.

<hr>

<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 <tt><b>UniqueID</b></tt> values between
4000000 and 4999999, coded like this (see the <a href="#Codes">tables of
codes</a> for font file names below):

<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Coding of UniqueID "<tt><b>4TTWVE0</b></tt>"</font><hr>
<tr>	<td><tt><b>TT</b></tt>
	<td>&nbsp;&nbsp;
	<td><a href="#Typeface">Typeface</a>
	<td>&nbsp;&nbsp;
	<td>two-digit identifier
<tr>	<td><tt><b>W</b></tt>
	<td>&nbsp;
	<td><a href="#Weight">Weight</a>
	<td>&nbsp;
	<td>normal, bold, etc.
<tr>	<td><tt><b>V</b></tt>
	<td>&nbsp;
	<td><a href="#Variant">Variant</a>
	<td>&nbsp;
	<td>normal, italic, etc.
<tr>	<td><tt><b>E</b></tt>
	<td>&nbsp;
	<td><a href="#Expansion">Expansion</a>
	<td>&nbsp;
	<td>normal, condensed, etc.
</table></blockquote>

<p>
This scheme will not work forever: as soon there are more than 99
typefaces, or more than 9 weights or variants, we will have to do something
else. But it suffices for the near future.

<p>
If you plan to distribute fonts, ask Adobe to assign you some UniqueIDs and
also an <tt><b>XUID</b></tt> 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
<tt><b>bdftops</b></tt> program creates XUIDs of the form
"<tt><b>[-X-&nbsp;0&nbsp;-U-]</b></tt>" where "<tt><b>-X-</b></tt>" is the
organization XUID and "<tt><b>-U-</b></tt>" 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.)

<p>
Because Ghostscript runs on many different systems, including DOS, the
names of font files can be no longer than 8 characters.  We therefore
construct a font's filename <tt><b>FTTWVVVE.gsf</b></tt>
similarly to the construction for temporary UniqueIDs.

<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Coding of font file name "<tt><b>FTTWVVVE.gsf</b></tt>"</font><hr>
<tr>	<td><tt><b>F</b></tt>
	<td>&nbsp;&nbsp;
	<td><a href="#Foundries">Foundry</a>
	<td>&nbsp;&nbsp;
	<td>&nbsp;
<tr>	<td><tt><b>TT</b></tt>
	<td>&nbsp;
	<td><a href="#Typeface">Typeface</a>
	<td>&nbsp;
	<td>two-digit identifier
<tr>	<td><tt><b>W</b></tt>
	<td>&nbsp;
	<td><a href="#Weight">Weight</a>
	<td>&nbsp;
	<td>normal, bold, etc.
<tr>	<td><tt><b>V</b></tt>
	<td>&nbsp;
	<td><a href="#Variant">Variant</a>
	<td>&nbsp;
	<td>normal, italic, etc.
<tr>	<td><tt><b>E</b></tt>
	<td>&nbsp;
	<td><a href="#Expansion">Expansion</a>
	<td>&nbsp;
	<td>normal, condensed, etc.
</table></blockquote>

<p>
Since a font can have multiple variants (for example, Lucida Regular Sans
Typewriter Italic) we allocate three letters to that; 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 "<b><tt>r</tt></b>" to make 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 <em>TUGboat</em> (the journal of the TeX Users Group).

<h3><a name="Codes"></a>Codes used to make font file names</h3>

<p>
In the following tables we make 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.

<p>
<a name="Foundries"></a>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=3 bgcolor="#CCCC00"><hr><font size="+1">Font foundry codes</font><hr>
<tr>	<th>ID
	<th>&nbsp;&nbsp;
	<th align=left>Foundry
<tr>	<td colspan=3><hr>
<tr>	<td><tt><b>b</b></tt>
	<td>&nbsp;&nbsp;
	<td>Bitstream
<tr>	<td><tt><b>f</b></tt>
	<td>&nbsp;
	<td>Freely distributable and public-domain
<tr>	<td><tt><b>hr</b></tt>
	<td>&nbsp;
	<td>Hershey
<tr>	<td><tt><b>n</b></tt>
	<td>&nbsp;
	<td>IBM
<tr>	<td><tt><b>p</b></tt>
	<td>&nbsp;
	<td>Adobe ("p" for PostScript)
<tr>	<td><tt><b>u</b></tt>
	<td>&nbsp;
	<td>URW[++]
</table></blockquote>

<p>
<a name="Typeface"></a>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=7 bgcolor="#CCCC00"><hr><font size="+1">Typeface codes</font><hr>
<tr valign=bottom>	<th>ID
	<td>&nbsp;&nbsp;
	<th align=left>Name
	<td>&nbsp;&nbsp;
	<th align=left>Filename<br>prefix
	<td>&nbsp;&nbsp;
	<th align=left>Source
<tr>	<td colspan=7><hr>
<tr>	<td><tt><b>08</b></tt>
	<td>&nbsp;
	<td>Avant Garde
	<td>&nbsp;
	<td><tt><b>pag</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>11</b></tt>
	<td>&nbsp;
	<td>Bookman
	<td>&nbsp;
	<td><tt><b>pbk</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>01</b></tt>
	<td>&nbsp;
	<td>CharterBT
	<td>&nbsp;
	<td><tt><b>bch</b></tt>
	<td>&nbsp;
	<td>Bitstream
<tr>	<td><tt><b>02</b></tt>
	<td>&nbsp;
	<td>Courier
	<td>&nbsp;
	<td><tt><b>ncr</b></tt>
	<td>&nbsp;
	<td>IBM
<tr>	<td><tt><b>03</b></tt>
	<td>&nbsp;
	<td>Helvetica
	<td>&nbsp;
	<td><tt><b>phv</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>04</b></tt>
	<td>&nbsp;
	<td>New Century Schoolbook
	<td>&nbsp;
	<td><tt><b>pnc</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>09</b></tt>
	<td>&nbsp;
	<td>Palatino
	<td>&nbsp;
	<td><tt><b>ppl</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>05</b></tt>
	<td>&nbsp;
	<td>Symbol
	<td>&nbsp;
	<td><tt><b>psy</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>06</b></tt>
	<td>&nbsp;
	<td>Times
	<td>&nbsp;
	<td><tt><b>ptm</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td>--
	<td>&nbsp;
	<td>Utopia
	<td>&nbsp;
	<td><tt><b>put</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>07</b></tt>
	<td>&nbsp;
	<td>Zapf Chancery
	<td>&nbsp;
	<td><tt><b>zc</b></tt>
	<td>&nbsp;
	<td>public domain
<tr>	<td><tt><b>10</b></tt>
	<td>&nbsp;
	<td>Zapf Dingbats
	<td>&nbsp;
	<td><tt><b>pzd</b></tt>
	<td>&nbsp;
	<td>Adobe
<tr>	<td><tt><b>12</b></tt>
	<td>&nbsp;
	<td>public domain Cyrillic
	<td>&nbsp;
	<td><tt><b>fcy</b></tt>
	<td>&nbsp;
	<td>public domain
<tr>	<td><tt><b>13</b></tt>
	<td>&nbsp;
	<td>Kevin Hartig Hiragana
	<td>&nbsp;
	<td><tt><b>fhi</b></tt>
	<td>&nbsp;
	<td>shareware
<tr>	<td><tt><b>14</b></tt>
	<td>&nbsp;
	<td>Kevin Hartig Katakana
	<td>&nbsp;
	<td><tt><b>fka</b></tt>
	<td>&nbsp;
	<td>shareware
<tr>	<td><tt><b>90</b></tt>
	<td>&nbsp;
	<td>Hershey Gothic English
	<td>&nbsp;
	<td><tt><b>hrge</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>91</b></tt>
	<td>&nbsp;
	<td>Hershey Gothic Italian
	<td>&nbsp;
	<td><tt><b>hrit</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>92</b></tt>
	<td>&nbsp;
	<td>Hershey Gothic German
	<td>&nbsp;
	<td><tt><b>hrgr</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>93</b></tt>
	<td>&nbsp;
	<td>Hershey Greek
	<td>&nbsp;
	<td><tt><b>hrgk</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>94</b></tt>
	<td>&nbsp;
	<td>Hershey Plain
	<td>&nbsp;
	<td><tt><b>hrpl</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>95</b></tt>
	<td>&nbsp;
	<td>Hershey Script
	<td>&nbsp;
	<td><tt><b>hrsc</b></tt>
	<td>&nbsp;
	<td>freeware
<tr>	<td><tt><b>96</b></tt>
	<td>&nbsp;
	<td>Hershey Symbol
	<td>&nbsp;
	<td><tt><b>hrsy</b></tt>
	<td>&nbsp;
	<td>freeware
</table></blockquote>

<p>
<a name="Weight"></a>
<blockquote><table cellpadding=0 cellspacing=0>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1">Font weight codes</font><hr>
<tr>	<th>ID
	<td>&nbsp;&nbsp;
	<th align=left>Type
	<td>&nbsp;&nbsp;
	<th align=left>Filename
<tr>	<td colspan=5><hr>
<tr>	<td><tt><b>0</b></tt>
	<td>&nbsp;&nbsp;
	<td>normal
	<td>&nbsp;&nbsp;
	<td><tt><b>r</b></tt>
<tr>	<td><tt><b>1</b></tt>
	<td>&nbsp;
	<td>bold
	<td>&nbsp;
	<td><tt><b>b</b></tt>
<tr>	<td><tt><b>2</b></tt>
	<td>&nbsp;
	<td>book
	<td>&nbsp;
	<td><tt><b>k</b></tt>
<tr>	<td><tt><b>3</b></tt>
	<td>&nbsp;
	<td>demi
	<td>&nbsp;
	<td><tt><b>d</b></tt>
<tr>	<td><tt><b>4</b></tt>
	<td>&nbsp;
	<td>light
	<td>&nbsp;
	<td><tt><b>l</b></tt>
<tr>	<td>&nbsp;
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1"><a name="Variant"></a>Font variants</font><hr>
<tr>	<th>ID
	<td>&nbsp;&nbsp;
	<th align=left>Type
	<td>&nbsp;&nbsp;
	<th align=left>Filename
<tr>	<td colspan=5><hr>
<tr>	<td><tt><b>0</b></tt>
	<td>&nbsp;&nbsp;
	<td>normal
	<td>&nbsp;&nbsp;
	<td><tt><b>r</b></tt> (omitted when weight is normal)
<tr>	<td><tt><b>1</b></tt>
	<td>&nbsp;
	<td>italic
	<td>&nbsp;
	<td><tt><b>i</b></tt>
<tr>	<td><tt><b>2</b></tt>
	<td>&nbsp;
	<td>oblique
	<td>&nbsp;
	<td><tt><b>o</b></tt>
<tr valign=top>	<td><tt><b>3</b></tt>
	<td>&nbsp;
	<td>script, handwritten, swash
	<td>&nbsp;
	<td><tt><b>w</b></tt>
<tr>	<td>&nbsp;
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1"><a name="Expansion"></a>Expansion</font><hr>
<tr>	<th>ID
	<td>&nbsp;&nbsp;
	<th align=left>Type
	<td>&nbsp;&nbsp;
	<th align=left>Filename
<tr>	<td colspan=5><hr>
<tr>	<td><tt><b>0</b></tt>
	<td>&nbsp;&nbsp;
	<td>normal
	<td>&nbsp;&nbsp;
	<td><tt><b>r</b></tt> (omitted when weight and variant are normal)
<tr>	<td><tt><b>1</b></tt>
	<td>&nbsp;
	<td>narrow
	<td>&nbsp;
	<td><tt><b>n</b></tt>
</table></blockquote>

<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 "<b><tt>fonts.dir</tt></b>" and
"<b><tt>fonts.scale</tt></b>".  There are two main methods to configure
your display to use these files.

<ul>
<li><a href="#Using_xset">With <b><tt>xset</tt></b></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 <b><tt>xset</tt></b></h3>

<p>
Users without root access can add the Ghostscript font directories to the
font search path using <b><tt>xset</tt></b>. 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 <b><tt>xset</tt></b> should be added to
the user's "<b><tt>.xsession</tt></b>" or "<b><tt>.xinitrc</tt></b>"
startup script to make the fonts available at each login.

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

<blockquote>
<b><tt>xset fp+</tt> <em>{directory}</em></b>
</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>
<b><tt>/usr/local/Ghostscript/share/fonts</tt></b>
</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 <b><tt>xfs</tt></b> font server</h4>

<p>
An X display server can obtain its font resources from a dedicated X font
server.  <b><tt>xfs</tt></b> 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><b><tt>
/usr/lib/X11/fs/config
<br>/usr/X11/lib/X11/fs/config
<br>/usr/X11R6/lib/X11/fs/config
</tt></b></blockquote>

<p>
or some similar name. You can also use <b><tt>xfs</tt></b>'s
"<b><tt>-config</tt></b>" 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
"<b><tt>fonts.dir</tt></b>").  This list is specified with the
"<b><tt>catalogue=</tt></b>" 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><b><tt>
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/
</tt></b></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>
<b><tt>kill -HUP</tt> <em>{pid}</em></b>
</blockquote>

<p>
where <b><em>{pid}</em></b> is the font server process's numeric process
ID, as obtained with the "<b><tt>ps</tt></b>" 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 "<b><tt>/etc/XF86Config</tt></b>" setup
file to add a new "<b><tt>FontPath</tt></b>" to the "<b><tt>Files</tt></b>"
section:

<blockquote>
<b><tt>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</tt></b>
</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 <b><tt>xdm</tt></b>, 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; 1996, 1997, 1998, 1999, 2000 Aladdin
Enterprises. 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 the license contained in the file LICENSE in this distribution.

<p>
<small>Ghostscript version 7.07, 17 May 2003

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

</body>
</html>