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
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
|
<!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>
<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>
Additionally, a file <tt><b>cidfmap</b></tt> 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
<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>
<td><b>File name</b>
<td>
<td><b>Contents</b>
<td>
<td><b>Types</b>
<tr> <td colspan=7><hr>
<tr valign=top> <td>DOS and<br>MS Windows
<td>
<td><b><tt>gs###fn1.zip</tt></b>
<td>
<td>Basic
<td>
<td><b><tt>.pfb</tt></b>
<tr valign=top> <td>
<td>
<td><b><tt>gs###fn2.zip</tt></b>
<td>
<td>Miscellaneous
<td>
<td>Various, for<br>different fonts
<tr> <td colspan=7><hr>
<tr valign=top> <td>Unix
<td>
<td><b><tt>ghostscript-fonts-std-#.##.tar.gz</tt></b>
<td>
<td>Basic
<td>
<td><b><tt>.afm</tt></b>,
<b><tt>.pfb</tt></b>,<br><b><tt>.pfm</tt></b> <tr valign=top> <td>
<td>
<td><b><tt>ghostscript-fonts-other-#.##.tar.gz</tt></b>
<td>
<td>Miscellaneous
<td>
<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.
Fonts can be found at
<blockquote>
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs###/ (for a particular version)<br>
<a href="ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/"
class="offsite">ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/</a> (for
several versions)
</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 <tt><b>ttfont</b></tt> 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 <<a href="mailto:matsuda@itohws01.ee.noda.sut.ac.jp">matsuda@itohws01.ee.noda.sut.ac.jp</a>>
<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 <<a href="mailto:katayama@rd.nacsis.ac.jp">katayama@rd.nacsis.ac.jp</a>>
</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 <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 Roman</tt></b>",
"<b><tt>Tms Rmn</tt></b>",
"<b><tt>Times New 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.
<p>
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. 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
<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 BDF_filename [AFM_file1_name ...] gsf_filename fontname<br> UniqueID [XUID] [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>
<td>Input bitmap file in BDF format
<td>
<td>
<tr valign=top> <td><tt><b>AFM_file1_name</b></tt>
<td>
<td>AFM files giving metrics
<td>
<td>(Optional)
<tr valign=top> <td><tt><b>gsf_filename</b></tt>
<td>
<td>Output file
<td>
<td>
<tr valign=top> <td><tt><b>fontname</b></tt>
<td>
<td>Name of the font
<td>
<td>
<tr valign=top> <td><tt><b>UniqueID</b></tt>
<td>
<td>UniqueID (<a href="#Unique_IDs">as described below</a>)
<td>
<td>
<tr valign=top> <td><tt><b>XUID</b></tt>
<td>
<td>XUID, in the form <tt><b>n1.n2.n3...</b></tt> (<a href="#Unique_IDs">as described below</a>)
<td>
<td>(Optional)
<tr valign=top> <td><tt><b>encodingname</b></tt>
<td>
<td>"StandardEncoding" (the default), "ISOLatin1Encoding",<br>"SymbolEncoding", "DingbatsEncoding"
<td>
<td>(Optional)
</table></blockquote>
<p>
For instance
<blockquote><tt><b>
bdftops pzdr.bdf ZapfDingbats.afm pzdr.gsf ZapfDingbats 4100000 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 $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)pipe.dev
</b></tt></blockquote>
<p>
and add "ccfonts.dev":
<blockquote><tt><b>
FEATURE_DEVS=$(PSD)psl3.dev $(PSD)pdf.dev $(PSD)dpsnext.dev $(PSD)pipe.dev $(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 NewCenturySchlbk-BoldItalic pncbi.c 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>
<td><tt><b>ccfonts12=pncbi</b></tt>
<tr> <td>Rather than
<td>
<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>
<td><a href="#Typeface">Typeface</a>
<td>
<td>two-digit identifier
<tr> <td><tt><b>W</b></tt>
<td>
<td><a href="#Weight">Weight</a>
<td>
<td>normal, bold, etc.
<tr> <td><tt><b>V</b></tt>
<td>
<td><a href="#Variant">Variant</a>
<td>
<td>normal, italic, etc.
<tr> <td><tt><b>E</b></tt>
<td>
<td><a href="#Expansion">Expansion</a>
<td>
<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- 0 -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>
<td><a href="#Foundries">Foundry</a>
<td>
<td>
<tr> <td><tt><b>TT</b></tt>
<td>
<td><a href="#Typeface">Typeface</a>
<td>
<td>two-digit identifier
<tr> <td><tt><b>W</b></tt>
<td>
<td><a href="#Weight">Weight</a>
<td>
<td>normal, bold, etc.
<tr> <td><tt><b>V</b></tt>
<td>
<td><a href="#Variant">Variant</a>
<td>
<td>normal, italic, etc.
<tr> <td><tt><b>E</b></tt>
<td>
<td><a href="#Expansion">Expansion</a>
<td>
<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>
<th align=left>Foundry
<tr> <td colspan=3><hr>
<tr> <td><tt><b>b</b></tt>
<td>
<td>Bitstream
<tr> <td><tt><b>f</b></tt>
<td>
<td>Freely distributable and public-domain
<tr> <td><tt><b>hr</b></tt>
<td>
<td>Hershey
<tr> <td><tt><b>n</b></tt>
<td>
<td>IBM
<tr> <td><tt><b>p</b></tt>
<td>
<td>Adobe ("p" for PostScript)
<tr> <td><tt><b>u</b></tt>
<td>
<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>
<th align=left>Name
<td>
<th align=left>Filename<br>prefix
<td>
<th align=left>Source
<tr> <td colspan=7><hr>
<tr> <td><tt><b>08</b></tt>
<td>
<td>Avant Garde
<td>
<td><tt><b>pag</b></tt>
<td>
<td>Adobe
<tr> <td><tt><b>11</b></tt>
<td>
<td>Bookman
<td>
<td><tt><b>pbk</b></tt>
<td>
<td>Adobe
<tr> <td><tt><b>01</b></tt>
<td>
<td>CharterBT
<td>
<td><tt><b>bch</b></tt>
<td>
<td>Bitstream
<tr> <td><tt><b>02</b></tt>
<td>
<td>Courier
<td>
<td><tt><b>ncr</b></tt>
<td>
<td>IBM
<tr> <td><tt><b>03</b></tt>
<td>
<td>Helvetica
<td>
<td><tt><b>phv</b></tt>
<td>
<td>Adobe
<tr> <td><tt><b>04</b></tt>
<td>
<td>New Century Schoolbook
<td>
<td><tt><b>pnc</b></tt>
<td>
<td>Adobe
<tr> <td><tt><b>09</b></tt>
<td>
<td>Palatino
<td>
<td><tt><b>ppl</b></tt>
<td>
<td>Adobe
<tr> <td><tt><b>05</b></tt>
<td>
<td>Symbol
<td>
<td><tt><b>psy</b></tt>
<td>
<td>Adobe
<tr> <td><tt><b>06</b></tt>
<td>
<td>Times
<td>
<td><tt><b>ptm</b></tt>
<td>
<td>Adobe
<tr> <td>--
<td>
<td>Utopia
<td>
<td><tt><b>put</b></tt>
<td>
<td>Adobe
<tr> <td><tt><b>07</b></tt>
<td>
<td>Zapf Chancery
<td>
<td><tt><b>zc</b></tt>
<td>
<td>public domain
<tr> <td><tt><b>10</b></tt>
<td>
<td>Zapf Dingbats
<td>
<td><tt><b>pzd</b></tt>
<td>
<td>Adobe
<tr> <td><tt><b>12</b></tt>
<td>
<td>public domain Cyrillic
<td>
<td><tt><b>fcy</b></tt>
<td>
<td>public domain
<tr> <td><tt><b>13</b></tt>
<td>
<td>Kevin Hartig Hiragana
<td>
<td><tt><b>fhi</b></tt>
<td>
<td>shareware
<tr> <td><tt><b>14</b></tt>
<td>
<td>Kevin Hartig Katakana
<td>
<td><tt><b>fka</b></tt>
<td>
<td>shareware
<tr> <td><tt><b>90</b></tt>
<td>
<td>Hershey Gothic English
<td>
<td><tt><b>hrge</b></tt>
<td>
<td>freeware
<tr> <td><tt><b>91</b></tt>
<td>
<td>Hershey Gothic Italian
<td>
<td><tt><b>hrit</b></tt>
<td>
<td>freeware
<tr> <td><tt><b>92</b></tt>
<td>
<td>Hershey Gothic German
<td>
<td><tt><b>hrgr</b></tt>
<td>
<td>freeware
<tr> <td><tt><b>93</b></tt>
<td>
<td>Hershey Greek
<td>
<td><tt><b>hrgk</b></tt>
<td>
<td>freeware
<tr> <td><tt><b>94</b></tt>
<td>
<td>Hershey Plain
<td>
<td><tt><b>hrpl</b></tt>
<td>
<td>freeware
<tr> <td><tt><b>95</b></tt>
<td>
<td>Hershey Script
<td>
<td><tt><b>hrsc</b></tt>
<td>
<td>freeware
<tr> <td><tt><b>96</b></tt>
<td>
<td>Hershey Symbol
<td>
<td><tt><b>hrsy</b></tt>
<td>
<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>
<th align=left>Type
<td>
<th align=left>Filename
<tr> <td colspan=5><hr>
<tr> <td><tt><b>0</b></tt>
<td>
<td>normal
<td>
<td><tt><b>r</b></tt>
<tr> <td><tt><b>1</b></tt>
<td>
<td>bold
<td>
<td><tt><b>b</b></tt>
<tr> <td><tt><b>2</b></tt>
<td>
<td>book
<td>
<td><tt><b>k</b></tt>
<tr> <td><tt><b>3</b></tt>
<td>
<td>demi
<td>
<td><tt><b>d</b></tt>
<tr> <td><tt><b>4</b></tt>
<td>
<td>light
<td>
<td><tt><b>l</b></tt>
<tr> <td>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1"><a name="Variant"></a>Font variants</font><hr>
<tr> <th>ID
<td>
<th align=left>Type
<td>
<th align=left>Filename
<tr> <td colspan=5><hr>
<tr> <td><tt><b>0</b></tt>
<td>
<td>normal
<td>
<td><tt><b>r</b></tt> (omitted when weight is normal)
<tr> <td><tt><b>1</b></tt>
<td>
<td>italic
<td>
<td><tt><b>i</b></tt>
<tr> <td><tt><b>2</b></tt>
<td>
<td>oblique
<td>
<td><tt><b>o</b></tt>
<tr valign=top> <td><tt><b>3</b></tt>
<td>
<td>script, handwritten, swash
<td>
<td><tt><b>w</b></tt>
<tr> <td>
<tr><th colspan=5 bgcolor="#CCCC00"><hr><font size="+1"><a name="Expansion"></a>Expansion</font><hr>
<tr> <th>ID
<td>
<th align=left>Type
<td>
<th align=left>Filename
<tr> <td colspan=5><hr>
<tr> <td><tt><b>0</b></tt>
<td>
<td>normal
<td>
<td><tt><b>r</b></tt> (omitted when weight and variant are normal)
<tr> <td><tt><b>1</b></tt>
<td>
<td>narrow
<td>
<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 = /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> RgbPath "/usr/X11R6/lib/X11/rgb"
<br> FontPath "/usr/local/share/Ghostscript/fonts"
<br> FontPath "/usr/X11R6/lib/X11/fonts/misc:unscaled"
<br> FontPath "/usr/X11R6/lib/X11/fonts/75dpi:unscaled"
<br> FontPath "/usr/X11R6/lib/X11/fonts/100dpi:unscaled"
<br> FontPath "/usr/X11R6/lib/X11/fonts/Type1"
<br> FontPath "/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
<<a href="mailto:eegs@phoe.frmug.org">eegs@phoe.frmug.org</a>>
<!-- [2.0 end contents] ==================================================== -->
<!-- [3.0 begin visible trailer] =========================================== -->
<hr>
<p>
<small>Copyright © 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.
For more information about licensing, please refer to
http://www.ghostscript.com/licensing/. For information on
commercial licensing, go to http://www.artifex.com/licensing/ or
contact Artifex Software, Inc., 101 Lucas Valley Road #110,
San Rafael, CA 94903, U.S.A., +1(415)492-9861.
<p>
<small>Ghostscript version 8.53, 20 October 2005
<!-- [3.0 end visible trailer] ============================================= -->
</body>
</html>
|