1This file explains how to install the fonts that come with the GNU
2plotutils package, and other useful fonts.  Before reading this, you may
3find it useful to read the file INSTALL for generic remarks on installing
4GNU packages, and the file INSTALL.pkg for package-specific installation
5instructions.
6
7The fonts this file discusses are: (1) the 35 standard `Postscript fonts',
8clones of which come with the package, (2) the 4 standard `Tektronix
9fonts', which do also, and (3) the 45 standard `HP LaserJet fonts', which
10do not come with the package, but which you can get for free from
11Hewlett-Packard via the Internet.
12
131. The 35 standard Postscript fonts
14-----------------------------------
15
16These `Postscript fonts' are the 35 scalable fonts from Adobe that are
17built into nearly all Postscript printers.  They include Times-Roman,
18Helvetica, Courier, New Century Schoolbook, Palatino, Bookman, AvantGarde,
19ZapfChancery, and ZapfDingbats.
20
21You will get the greatest value out of the plotutils package, when running
22under X Windows, if these fonts are available on your X display.  (In some
23cases, versions at fixed font sizes are available, but the scalable font
24that gives rise to them is not.)  For example, the default font which the
25`graph' program uses is `Helvetica'.  If it is unavailable, a scalable
26stroked font (one made up of line segments) named `HersheySerif' will
27automatically be substituted for it.  But it would be good to use the
28default Helvetica font.
29
30Many X servers (for example, many releases of XFree86 for GNU/Linux) do not
31supply all 35 standard Postscript fonts.  In many cases, they can be added
32by installing a freely available package, such as an .rpm file or Debian
33package.  For instance, the 35 standard Postscript fonts can be added to a
34Debian system by installing the `gsfonts-x11' package from Debian.
35Actually, what will be added are clones of the 35 Adobe fonts, since the
36original fonts from Adobe are non-free.
37
38If you cannot locate an add-on package that contains clones of the 35 Adobe
39fonts, you may install the cloned versions that are supplied in the
40subdirectory ./fonts/pfb, in Type 1 format.  These were designed by URW
41GmBH of Germany and contributed for distribution under the GNU License.
42
43Manually adding fonts to an X server is not difficult, though you should
44note that most X servers now support two font systems: the original `core'
45X font system, and a new one based on Xft and the FreeType rasterizer.  For
46backward compatibility, the plotutils package uses only core X fonts.  Core
47fonts (scalable ones, anyway) are usually supplied in Adobe's Type 1
48format.  The files in .fonts/pfb are in this format.
49
50You can manually add Type 1 fonts to the core X font subsystem by using the
51basic command-line `mkfontdir', as root.  The following instructions assume
52that you have a generic X Window System installation.  If you have anything
53more fancy, consult your local documentation to determine how to add fonts
54in Type-1 format to it.
55
56To install the 35 Postscript fonts to a generic X Window System
57installation, first locate the directory on your system in which Type 1
58fonts are stored.  (It will be /usr/share/fonts/X11/Type1,
59/usr/lib/X11/fonts/Type1, or something similar.)  Copy the 35 font files in
60./fonts/pfb to that directory.  There will presumably be a file named
61`fonts.scale' in that directory, which lists scalable fonts the X server
62can use.  To let the X server know about your new font files, copy the
63lines in the file ./fonts/fonts.append to the end of the fonts.scale file,
64and correct the first line of the fonts.scale file (a count of the number
65of scalable fonts) by adding 35 to it.  Then, while in that directory, run
66the `mkfontdir' program.  The `mkfontdir' program creates a file called
67`fonts.dir', which is what the X server will read (it does not actually
68read fonts.scale).  If the X server is currently running, you should also
69do `xset fp rehash' to make the server re-scan the directory; or simply log
70out and log back in again.
71
72NOTE #1: On Solaris machines, the preceding installation instructions may
73or may not work.  Some versions of Solaris contain a Sun demo program
74called `fontadmin' that can install Type1 fonts.  If it is available, it is
75located in `/usr/openwin/demos'.
76
77NOTE #2: On a few systems (e.g., SGI's), following the preceding
78instructions may cause problems, because vendor-supplied versions of (some
79of) the fonts may already appear in the fonts.scale file.  It would be a
80good idea on _any_ system to check whether any of the fonts listed in
81./fonts/fonts.append already appear in fonts.scale.  If so, the
82corresponding lines do not need to be added.
83
842. The 4 standard Tektronix fonts
85---------------------------------
86
87If you plan to use the `tek2plot' utility, you may wish to install the four
88standard Tektronix fonts on your X server, so that you can view Tektronix
89images containing text with the original fonts.  Bitmap versions of the
90four fonts come with the package.  `tek2plot -T X' will use them if you
91specify the `--use-tek-fonts' option.
92
93To install the 4 Tektronix fonts, first locate the directory on your system
94in which miscellaneous bitmap fonts are stored (it will be
95/usr/share/fonts/X11/misc, /usr/lib/X11/fonts/misc, or something similar).
96Copy the 4 font files in ./fonts/pcf to that directory.  Then, while in
97that directory, run the `mkfontdir' program.  The `mkfontdir' program
98creates a file called `fonts.dir', which is what the X server will read.
99If the X server is currently running, you should also do `xset fp rehash'
100to make the server re-scan the directory; or simply log out, and log back in.
101
1023. The 45 standard LaserJet fonts
103---------------------------------
104
105These fonts are the 45 scalable "LaserJet" fonts that are built into all
106modern HP LaserJets.  (Since the LaserJet 6, 5, and 4 at least; the ancient
107LaserJet III, which was the first one to support scalable fonts, included
108only 8 of the 45.)  They include Times New Roman, Arial, Univers, Garamond,
109CGTimes, CGOmega, Courier, Letter Gothic, Symbol, and Wingdings.
110
111To understand the following instructions, note that all modern high-end
112LaserJets can understand both Postscript and PCL 5 (or these days, its
113extensions PCL 6 or PCL 6e).  PCL 5 incorporates the traditional
114pen-plotter command language for high-end HP pen plotters, HP-GL/2.  PCL 5
115was the original command language understood by high-end LaserJets
116(Postscript from Adobe being added later), and originally it came with its
117own set of 45 scalable fonts.  Eventually, the 45 PCL fonts became
118accessible from the `Postscript side' as well.
119
120The plotting utilities can produce PCL 5 or HP-GL/2 output, which is meant
121to be sent to a LaserJet or similar printer or plotter.  For example,
122`graph -T pcl' and `graph -T hpgl' can do this.  When producing PCL 5 and
123HP-GL/2 output, they can use any of the 45 LaserJet fonts.
124
125You may also wish to use them when producing output for an X Window System
126display, or when producing Postscript output.  Here is how you can do this
127(the first is much easier than the second).
128
129A. When you configure and install the plotting utilities package, be sure
130to do `./configure --enable-lj-fonts-in-x' instead of just `./configure'.
131
132B. Obtain and install the 45 LaserJet fonts.  Hewlett-Packard has made
133Type 1 versions of these fonts available via the Internet, at
134ftp://ftp.hp.com/pub/printers/software/mp135mu.exe .
135This is a zipped file, which you can unzip with the `unzip' utility.  You
136will get 45 font files, in .pfb ("Postscript Font, Binary") format.
137
138The following instructions assume that you have a generic X Window System
139installation.  If you have something more fancy, consult your local
140documentation to determine how to intall new fonts.
141
142To install the 45 LaserJet fonts so that your X server will be able to use
143them, first locate the directory on your system in which Type 1 fonts for
144the X Window System are stored.  (It will be
145/usr/share/lib/X11/fonts/Type1, /usr/lib/X11/fonts/Type1, or something
146similar.)  Copy the 45 .pfb files to that directory.  There will probably
147be a file named `fonts.scale' in that directory, which lists scalable fonts
148the X server can use.  To let the X server know about the new font files,
149copy the lines in the file ./fonts/fonts3.append to the end of the
150fonts.scale file, and correct the first line of the fonts.scale file (a
151count of the number of scalable fonts) by adding 45 to it.  Then, while in
152that directory, run the `mkfontdir' program.  The `mkfontdir' program
153creates a file called `fonts.dir', which is what the X server will read.
154If the X server is currently running, you should also do `xset fp rehash'
155to make the server re-scan the directory.
156
157NOTE: On Solaris machines, the preceding installation instructions may or
158may not work.  Some versions of Solaris contain a Sun demo program called
159`fontadmin' that can install Type1 fonts.  If it is available, it is
160located in `/usr/openwin/demos'.
161
162C. After steps (A) and (B) are followed, the plotting utilities will be
163able to use the 45 LaserJet fonts when producing X output.  For example,
164you will be able to do
165
166	echo 0 0 1 1 2 0 | graph -T X -F Arial-Bold
167
168to pop up a simple plot on your screen, labelled in Arial-Bold.  If you do
169`graph -T X --help-fonts' or `plotfont -T X --help-fonts', the list of
170fonts you are shown will include the 45.
171
172D. You may wish to use the 45 new fonts in Postscript output as well.  This
173is harder, and to some extent, you are on your own on this.  What follows
174is a (long!) explanation of what you can do.
175
176If you want to produce, view, and print Postscript files that contain the
17745 LaserJet fonts, you should first add the `--enable-lj-fonts-in-ps'
178option to `./configure'.  In principle, this is enough: it will let you
179produce Postscript output that uses the 45 LaserJet fonts.  The problem is
180that your Postscript interpreter, printer, or printer driver may not know
181about these new fonts.
182
183It is easiest to add support for the new fonts to the Ghostscript engine,
184and to such previewers as Ghostview (`gv') that are built on top of it.  To
185do this, (i) add the 45 .pfb files to the directory in which Ghostscript
186looks for Type 1 fonts, such as /usr/share/fonts/type1/gsfonts, and (ii)
187add 45 new entries to the Ghostscript `Fontmap' file, one per font.  The
188Fontmap file is usually somewhere under /usr/share/ghostscript,
189/usr/share/gs, /usr/share/gs-gpl, or some such directory.  It may be named
190`Fontmap.GS' rather than `Fontmap'.  The format of this file should be
191self-explanatory: it lists the name of each font and the name of the .pfb
192file (presumably, kept in a standard directory such as
193/usr/share/fonts/type1/gsfonts) that contains it.  The 45 .pfb files from
194Hewlett-Packard have obscure names, but by looking at their contents with
195GNU Emacs or another editor, one can figure out which file contains which
196font.  For example, the file `0037____.pfb' contains the Arial-Roman font.
197(It uses the name `Arial-Roman', not `Arial'.)  The fontname <-> filename
198correspondence is documented in the file readme.hp.
199
200In consequence, you should add, at the end of the Fontmap.GS file, the
201following 45 lines:
202
203\AlbertusMedium (0001____.pfb) ;
204\AlbertusExtraBold (0002____.pfb) ;
205\AntiqueOlive (0003____.pfb) ;
206\AntiqueOlive-Italic (0004____.pfb) ;
207\AntiqueOlive-Bold (0005____.pfb) ;
208\ClarendonCondensed (0006____.pfb) ;
209\Coronet (0007____.pfb) ;
210\Courier (0008____.pfb) ;
211\Courier-Italic (0009____.pfb) ;
212\Courier-Bold (0010____.pfb) ;
213\Courier-BoldItalic (0011____.pfb) ;
214\Garamond (0012____.pfb) ;
215\Garamond-Italic (0013____.pfb) ;
216\Garamond-Bold (0014____.pfb) ;
217\Garamond-BoldItalic (0015____.pfb) ;
218\LetterGothic (0016____.pfb) ;
219\LetterGothic-Italic (0017____.pfb) ;
220\LetterGothic-Bold (0018____.pfb) ;
221\Marigold (0020____.pfb) ;
222\CGOmega (0021____.pfb) ;
223\CGOmega-Italic (0022____.pfb) ;
224\CGOmega-Bold (0023____.pfb) ;
225\CGOmega-BoldItalic (0024____.pfb) ;
226\CGTimes (0025____.pfb) ;
227\CGTimes-Italic (0026____.pfb) ;
228\CGTimes-Bold (0027____.pfb) ;
229\CGTimes-BoldItalic (0028____.pfb) ;
230\Univers (0029____.pfb) ;
231\Univers-Italic (0030____.pfb) ;
232\Univers-Bold (0031____.pfb) ;
233\Univers-BoldItalic (0032____.pfb) ;
234\UniversCondensed (0033____.pfb) ;
235\UniversCondensed-Italic (0034____.pfb) ;
236\UniversCondensed-Bold (0035____.pfb) ;
237\UniversCondensed-BoldItalic (0036____.pfb) ;
238\Arial-Roman (0037____.pfb) ;
239\Arial-Italic (0038____.pfb) ;
240\Arial-Bold (0039____.pfb) ;
241\Arial-BoldItalic (0040____.pfb) ;
242\TimesNewRoman (0041____.pfb) ;
243\TimesNewRoman-Italic (0042____.pfb) ;
244\TimesNewRoman-Bold (0043____.pfb) ;
245\TimesNewRoman-BoldItalic (0044____.pfb) ;
246\Symbol (symbol____.pfb) ;
247\Tidbits (tidbits____.pfb) ;
248
249after copying the 45 .pfb files into that directory.  This will be enough
250to make the 45 new fonts accessible to Ghostscript/Ghostview, so that a
251command such as
252
253  echo 0 0 1 1 2 0 | spline | graph -Tps -F Univers -C -q 0.5 | gv -
254
255will work.
256
257In some operating systems, such as Debian GNU/Linux, it is possible to make
258these 45 new fonts available to other applications than
259Ghostscript/Ghostview, without even copying them to other directories.  For
260instance, Debian has the `defoma' font manager, which can be configured to
261do this.  The details of this are not discussed here.
262
263In general, it would be desirable to use the 45 LaserJet fonts not just for
264use by Ghostview (or other screen-using applications), but for printing on
265a printer (Postscript or otherwise).  This can be painful, since
266appropriate font(s) will need to be downloaded to the printer, either
267separately or as part of the document (e.g., plot) that you wish to print.
268(This assumes that your printer driver is not intelligent enough to include
269the font(s), by itself.)
270
271The current release of the plotting utilities unfortunately does not
272support automatically including the fonts in Postscript output files.  But
273if you have a sophisticated printer driver or document manager that
274automatically includes fonts in documents, then it should be easy for you
275to add support for the 45 LaserJet fonts.  (The PS output of such utilities
276as `graph' will indicate to the driver or manager which fonts should be
277included.)  On this, you are on your own, though.
278
279As an alternative, you may manually download the 45 new fonts, or whichever
280ones of them you are using, to your Postscript printer.  This works quite
281well, though whenever you turn the printer off, the fonts go away.  To do
282this, you should first convert the relevant .pfb file(s), which are in
283binary, to .pfa file(s), which are in human readable ["Postscript Font,
284Ascii"] format.  There is a standard program, `t1ascii', which can do this.
285It is part of the `t1utils' package, which is available for many versions
286of GNU/Linux, and in standard archives.  After converting the .pfb files to
287.pfa files, you would send each of the needed .pfa files to your printer,
288as if it were a Postscript document to be printed.  Be sure to precede each
289.pfa file by the magic lines
290
291%!PS-Adobe-3.0 ExitServer
292%%BeginExitServer: 0
293serverdict begin 0 exitserver
294%%EndExitServer
295
296which will ensure the font stays resident in the printer, at least until it
297is turned off.
298
299For example, the file `0037____.pfb' from Hewlett-Packard contains the
300Arial-Roman font.  If you convert it to `0037____.pfa' with `t1ascii' and
301download it to your printer, you will be able to print an Arial-Roman plot
302by doing, e.g.,
303
304	echo 0 0 1 1 2 0 | graph -T ps -F Arial-Roman | lpr
305
306This procedure is awkward, and may be improved in future releases.
307
308One final comment.  The LaserJet font in the file `tidbits_.pfb' from
309Hewlett-Packard is actually Wingdings, despite its name.
310