INSTALL.fonts 15 KB

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