home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / clipart / gs22.zip / FONTS.DOC < prev    next >
Text File  |  1991-05-02  |  8KB  |  182 lines

  1.    Copyright (C) 1990, 1991 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.
  19.  
  20. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  21.  
  22. This file, fonts.doc, describes the fonts and font facilities supplied
  23. with Ghostscript.
  24.  
  25. For an overview of Ghostscript and a list of the documentation files, see
  26. README.
  27.  
  28. Ghostscript fonts
  29. -----------------
  30.  
  31. The fonts included with Ghostscript come in several parts:
  32.  
  33.     - Font data in files *.gsf: each file defines one (transformable)
  34.       font specified in outline form.
  35.  
  36.     - BuildChar procedures in gs_fonts.ps: these provide the
  37.       algorithms for interpreting the data in the .gsf files.
  38.  
  39.     - The Fontmap file: this relates Ghostscript font names to .gsf
  40.           file names. 
  41.  
  42. Currently, the fonts supplied with Ghostscript are based on various public
  43. domain bitmap fonts, mostly the ones supplied with the X11 distribution
  44. from MIT, and on the public domain Hershey fonts.  The fonts are
  45. distributed in the file `ghostscript-N.NNfonts.tar.Z'.  The bitmap-derived
  46. fonts include the usual Helvetica, Times-Roman, and so on; see the file
  47. `Fontmap' for the complete list, in the usual roman, italic, bold, and
  48. bold italic styles (for the most part).  The Hershey fonts, on the other
  49. hand, are quite different from traditional ones; the file `hershey.doc'
  50. describes them in more detail.
  51.  
  52. There is also a single rather heavy home-grown font called Ugly.  This
  53. font is the file `uglyr.gsf' in the Ghostscript source distribution.
  54.  
  55. The file gs_fonts.ps, which is loaded as part of Ghostscript
  56. initialization, arranges to load fonts on demand using the information
  57. from Fontmap.  If you want to preload all of the known fonts, invoke the
  58. procedure
  59.     loadallfonts
  60. This is not done by default, since the fonts occupy about 50K each and there
  61. are a lot of them.
  62.  
  63. Ghostscript fonts are actually ordinary Ghostscript programs: they use the
  64. extension .gsf instead of .ps simply to be informative.  This convention
  65. is only embodied in the Fontmap file: there is no code that knows about
  66. it.
  67.  
  68. If you want to try out the fonts, prfont.ps contains code for printing a
  69. sampler.  Load this program, by including it in the gs command line or by
  70. invoking
  71.     (prfont.ps) run
  72. and then to produce a sampler of a particular font, invoke
  73.     /fontName DoFont
  74. e.g.
  75.     /Times-Roman DoFont
  76.  
  77.  
  78. Contents of fonts
  79. -----------------
  80.  
  81. A Ghostscript font is a dictionary with a standard set of keys as follows.
  82. The keys marked with a * have the same meanings as in P*stScr*pt fonts;
  83. those marked with # have the same meanings as in Adobe Type 1 fonts.  Note
  84. that FontName is required; StrokeWidth is required for all stroked or
  85. outlined fonts; and Metrics is not currently supported.
  86.  
  87. *    - FontMatrix <array>: the transformation from character
  88.       coordinates to user coordinates.
  89.  
  90. *    - FontType <integer>: the type of the font, either 1 or 3.
  91.  
  92. *    - FontBBox <array>: the bounding box of the font.
  93.  
  94. *    - Encoding <array>: the map from character codes to character
  95.       names.
  96.  
  97. *    - FontName <name>: the name of the font.
  98.  
  99. *    - PaintType <integer>: an indication of how to interpret the
  100.       character description from CharInfo.
  101.  
  102. *    - StrokeWidth <number>: the stroke width for outline fonts.
  103.  
  104. *    - FontInfo <dictionary>: additional information about the font
  105.       (optional, not used by the standard Ghostscript software).
  106.  
  107. *    - UniqueID <integer>: a unique number identifying the font.
  108.  
  109. *    - BuildChar <procedure>: the procedure for showing a character
  110.       (not required in type 1 fonts).
  111.  
  112. #    - CharStrings <dictionary>: the map from character names to character
  113.       descriptions (relevant only in type 1 fonts).
  114.  
  115. #    - Private <dictionary>: additional information used by the
  116.       algorithms for rendering outlines fonts (relevant only in type 1
  117.       fonts).
  118.  
  119. The format of values in the CharStrings and Private dictionaries are
  120. described in the Adobe Type 1 Font Format book.
  121.  
  122.  
  123. Adding your own fonts
  124. ---------------------
  125.  
  126. The program bdftops.ps (and invoking shell script bdftops.bat or bdftops)
  127. converts these bitmap files to Ghostscript input, using the Ghostscript
  128. ``type1imagepath'' operator to convert the bitmaps into outlines.
  129.  
  130. If you want to add fonts of your own, you need to do two things.  First,
  131. edit Fontmap to include an entry for your new font at the end.  The format
  132. for entries is documented in the Fontmap file.  Second, you need to
  133. prepare the .gsf file.  If you are converting a file from BDF format, the
  134. Ghostscript distribution already includes a program for doing this: run
  135. the shell command
  136.     bdftops <bdf_file_name> <your_gsf_file_name>
  137. e.g.,
  138.     bdftops /wherever_X_fonts_live/zapfR24.bdf pzdr.gsf
  139.  
  140. The output file must be in the current directory, and must match the name
  141. in the Fontmap file.  After doing the conversion, you can move the
  142. resulting .gsf file to wherever you like.
  143.  
  144. There is a similar utility to convert files from .PFB form to plain text
  145. .gsf form.  Run the shell command
  146.     pfbtops <.PFB_file_name> <gsf_file_name>
  147. e.g.,
  148.     pfbtops timesrmn.pfb ptmr.gsf
  149.  
  150.  
  151. Outstanding problems and questions
  152. ----------------------------------
  153.  
  154.  -  At large magnifications the characters look lumpy, and the
  155.     100x100 dpi fonts don't help that.  What we need is some way to
  156.     refine the fonts.  I can think of several ways to approach it.
  157.     First, we could take these fonts, render them at a large scale
  158.     (say, 360), capture the bitmaps, clean up the bitmaps by hand,
  159.     then convert them back.  Second, we could add a smoothing
  160.     algorithm to type1imagepath.  Third, we could expand the charpath
  161.     data, edit the paths, then compress the paths back to charpath's.
  162.     None of these is very exciting.
  163.  
  164. Since Ghostscript uses the Adobe Type 1 format for fonts, there are lots
  165. of opportunities for improvement.  Eventually, the right approach is to
  166. use higher-quality fonts, and to implement some of the Type 1 hint
  167. facilities.
  168.  
  169. Work is underway to create high-quality fonts for Ghostscript in
  170. particular, and the GNU project in general.  The fonts distributed with
  171. the current release of Ghostscript have the redeeming value that they are
  172. available *now*.
  173.  
  174.  -  Is there a cure for the lightness of some of the fonts (e.g.,
  175.     Courier) at small sizes (e.g., 10pt)?
  176.  
  177. Ghostscript release 2.1 tried to compensate for this, and wound up making
  178. all fonts look too dark and bold.  Release 2.2 uses a different
  179. compensation method, which still produces too-light characters, but not as
  180. bad as in 2.0.  This is an area in which Ghostscript will probably improve
  181. rather slowly over time.
  182.