home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1996 February / PCWK0296.iso / sharewar / dos / program / gs300sr1 / gs300sr1.exe / USE.DOC < prev    next >
Text File  |  1994-07-27  |  40KB  |  983 lines

  1.    Copyright (C) 1989, 1992, 1993, 1994 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17.  
  18. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  19.  
  20. This file, use.doc, describes how to use the Ghostscript language
  21. interpreter.
  22.  
  23. For an overview of Ghostscript and a list of the documentation files, see
  24. README.  
  25.  
  26. ********
  27. ******** How to install Ghostscript ********
  28. ********
  29.  
  30. To run Ghostscript, you need the executable program, and also some
  31. external initialization files:
  32.     gs_*.ps (see psfiles.doc for the full list), unless Ghostscript was
  33.       compiled using the "compiled initialization files" option
  34.     Fontmap
  35.  
  36. The file name of the executable program depends on the environment;
  37. see the instructions for the specific platforms below.
  38.  
  39. The Ghostscript fileset includes a set of fonts (.gsf files); you should
  40. have them on line as well, unless you have a complete set of other fonts
  41. (such as ATM or Display PostScript fonts) and are using a Fontmap and/or
  42. GS_FONTPATH that references them.
  43.  
  44. VMS
  45. ---
  46.  
  47. Installing Ghostscript on a VMS system requires compiling it first.  The
  48. name of the executable is GS.EXE.
  49.  
  50. You should install all the files, including the fonts, in the same
  51. directory as the executable and initialization files.  By default, this is
  52. the directory in which you did the compilation.  Consult the command file
  53. (VMS*.MAK) for more details.
  54.  
  55. If you have DECWindows/Motif installed, you may wish to replace the FONTMAP
  56. file with the file FONTMAP.VMS.  Read the comment at the beginning of the
  57. latter file for more information.
  58.  
  59. MS-DOS
  60. ------
  61.  
  62. There are two MS-DOS executables in the standard Ghostscript
  63. distribution:
  64.     - GS.EXE runs on any MS-DOS machine, but is limited to 640K.
  65.     - GS386.EXE runs on any 386 or 486 machine, and will use all
  66. available extended (not expanded) memory.
  67.  
  68. You should install all the files except the fonts in C:\GS, and the
  69. fonts in C:\GS\FONTS.
  70.  
  71. If you have Adobe Type Manager fonts installed on your system, and you wish
  72. to use them with Ghostscript, you may wish to replace the FONTMAP file with
  73. FONTMAP.ATM, and to add to the environment variable GS_LIB the name of the
  74. directory where the fonts are located (see below for more information about
  75. GS_LIB).  Before you do this, please read carefully the license that
  76. accompanies the ATM fonts; Aladdin Enterprises takes no responsibility for
  77. any possible violations of such licenses.  Similarly, if you have Adobe
  78. Type Basics, you may wish to replace FONTMAP with FONTMAP.ATB.
  79.  
  80. MS Windows
  81. ----------
  82.  
  83. The name of the executable is GSWIN.EXE.  Ghostscript probably requires
  84. Windows 3.1, and you must run Windows in 386 Enhanced or Standard (not
  85. Real) mode.  Since Ghostscript is a large program, you will need to run
  86. Windows in Enhanced mode (so that it can provide virtual memory) unless
  87. you have at least 6 Mb of RAM.
  88.  
  89. You should install all the files except the fonts in C:\GS, and the fonts
  90. in C:\GS\FONTS.
  91.  
  92. See under "MS-DOS" above for information about using Adobe Type Manager
  93. fonts with Ghostscript.
  94.  
  95. The files COMMDLG.DLL and SHELL.DLL supplied with Ghostscript are only for
  96. use with Windows 3.0.  If you have Windows 3.1, delete these files, since
  97. Windows itself provides versions of them.
  98.  
  99. If your system uses TrueType fonts, you can get them converted to a
  100. Ghostscript-compatible format at the time you select your "printer" by
  101. doing the following:
  102.  
  103. 1)    Open control panel and double click on the printers icon.
  104. 2)    Select your Postscript Printer.
  105. 3)    Choose Setup.
  106. 4)    Choose Options.
  107. 5)    Choose Advanced.
  108. 6)    At the top of the Dialog Box you will see TrueType Fonts
  109.     Send to Printer As: <drop down menu>
  110.     Choose Adobe Type 1.
  111. 7)    Uncheck Use Printer Fonts for All TrueType Fonts
  112.     and Use Substitution Table.
  113. 8)    OK.
  114. 9)    OK etc.
  115.  
  116. That's it!  Your TrueType fonts will automatically be downloaded in your
  117. PostScript file for Ghostscript to use.
  118.  
  119. OS/2 2.x
  120. --------
  121.  
  122. The Ghostscript OS/2 implementation is designed for OS/2 2.1.  A few people
  123. have used it successfully under OS/2 2.0, but it has had very little
  124. testing.
  125.  
  126. The name of the executable is GSOS2.EXE.  This is a text application that
  127. will run windowed or full screen.  The default device is "os2pm" which
  128. displays output in a Presentation Manager window using the external driver
  129. GSPMDRV.EXE.  GSPMDRV.EXE must be located in the same directory as
  130. GSOS2.EXE or on the PATH.
  131.  
  132. GSOS2.EXE and GSPMDRV.EXE are compiled using EMX/GCC 0.8h.  You must have
  133. the EMX DLL's on your LIBPATH.  These are available from
  134. ftp.cdrom.com:pub/os2/2_x/unix/gnu/emx08h/emxrt.zip.
  135.  
  136. The system menu of the Ghostscript Image window includes a "Copy" command
  137. to copy the currently displayed bitmap to the Clipboard.
  138.  
  139. OS/2 comes with some Adobe Type Manager fonts. If you wish to use these
  140. with Ghostscript, you should replace the FONTMAP file with FONTMAP.OS2,
  141. and add to the environment variable GS_LIB the name of the directory where
  142. the fonts are located, usually c:\psfonts.  (see below for more
  143. information about GS_LIB).  Before you do this, please read carefully the
  144. license that accompanies the ATM fonts; Aladdin Enterprises takes no
  145. responsibility for any possible violations of such licenses.
  146.  
  147. Since GSOS2.EXE is not a PM application, it cannot determine the depth of
  148. the PM display.  You must provide this information using the
  149. -dBitsPerPixel option.  The default is 8 bits/pixel.  Valid values are 1,
  150. 4, 8, 16 & 24.
  151.   For monochrome VGA use      -dBitsPerPixel=1
  152.   For standard VGA screen use -dBitsPerPixel=4
  153.   For 256 colour SVGA use     -dBitsPerPixel=8
  154. A command file gspm.cmd containing the following line may be useful:
  155.   @c:\gs\gsos2.exe -Ic:/gs;c:/gs/fonts;c:/psfonts -sDEVICE=os2pm 
  156.       -dBitsPerPixel=8 -sPAPERSIZE=a4 %1 %2 %3 %4 %5 %6 %7 %8
  157.  
  158. While drawing, the os2pm driver updates the display every 5 seconds.  On
  159. slow computers this is undesirable and a different interval can be
  160. specified in milliseconds with the -dUpdateInterval option.  The default
  161. is -dUpdateInterval=5000; to disable update use -dUpdateInterval=0.
  162.  
  163. Standard VGA is very slow due to double buffering to avoid bugs and due to
  164. 1 plane to 4 plane conversion.  Use a 256 color display driver by
  165. preference.  Many display drivers have bugs which cause 1 bit/pixel
  166. bitmaps to be displayed incorrectly.
  167.  
  168. GSOS2.EXE and GSPMDRV.EXE will stay in memory for the number of minutes
  169. specified in the environment variable GS_LOAD.
  170.  
  171. Ghostscript can also be run in a DOS box.  Please read the MS-DOS notes, 
  172. since they apply to this environment as well.
  173.  
  174. If you run GS386 in the OS/2 2.0 or 2.1 DOS Box, you must select the
  175. "ENABLED" setting for the DPMI_DOS_API option of the DOS Box.  GS386
  176. will not run with the "AUTO" setting.
  177.  
  178. Unix
  179. ----
  180.  
  181. Installing Ghostscript on a Unix system requires compiling it first.
  182. The name of the executable is gs.  The makefile installs all the
  183. files, except the fonts, in /usr/local or various subdirectories
  184. thereof.  The fonts should be installed in
  185. /usr/local/lib/ghostscript/fonts.  Consult the makefile for more
  186. details.
  187.  
  188. ********
  189. ******** Shell scripts for Ghostscript
  190. ********
  191.  
  192. The Ghostscript distribution includes several Unix shell scripts for
  193. driving Ghostscript in different environments.  These are all
  194. user-contributed code: please contact the user identified in the file, not
  195. Aladdin Enterprises, if you have questions.
  196.  
  197. > pv.sh - preview a specified page of a dvi file in an X window.
  198.  
  199. > sysvlp.sh - System V 3.2 lp interface for parallel printer.
  200.  
  201. > pj-gs.sh - printing on an H-P PaintJet under HP-UX.
  202.  
  203. > unix-lpr.sh - queue filter for lpr under Unix.
  204. > lprsetup.sh - setup for unix-lpr.sh.
  205.  
  206. If one of these serves your needs, you may be able to skip most of
  207. the rest of this document.
  208.  
  209. ********
  210. ******** How to use Ghostscript ********
  211. ********
  212.  
  213. To invoke the interpreter, give the command
  214.     gs <filename1> ... <filenameN>
  215. The interpreter will read in the files in sequence and execute them.
  216. After doing this, it reads further input from the primary input stream
  217. (normally the keyboard).  Each line (i.e. characters up to a <return>) is
  218. interpreted separately.  To exit from the interpreter, type quit<return>.
  219. The interpreter also exits gracefully if it encounters end-of-file.
  220. Typing the interrupt character, e.g., control-C, is also safe.
  221.  
  222. The interpreter recognizes several switches described below, which may appear
  223. anywhere in the command line and apply to all files thereafter.
  224.  
  225. You can get a brief help message by invoking Ghostscript with
  226.     gs -h
  227. or
  228.     gs -?
  229. This message also lists the available devices.  For a little more
  230. information about available devices, a one-line description of each device
  231. appears near the beginning of the file devs.mak.
  232.  
  233. Choosing the output device
  234. --------------------------
  235.  
  236. Ghostscript may be built with multiple output devices.  Ghostscript
  237. normally opens the first one and directs output to it.  To use device xyz
  238. as the initial output device, include the switch
  239.     -sDEVICE=xyz
  240. in the command line.  Note that this switch must precede the first .ps
  241. file, and only its first invocation has any effect.  For example, for
  242. printer output in a normal configuration that includes an Epson printer
  243. driver, you might use the shell command
  244.     gs -sDEVICE=epson myfile.ps
  245. instead of just
  246.     gs myfile.ps
  247. Alternatively, once you are inside Ghostscript, you can type
  248.     (epson) selectdevice
  249.     (myfile.ps) run
  250. All output then goes to the printer instead of the display until further
  251. notice.  You can switch devices at any time by using the selectdevice
  252. procedure, e.g.,
  253.     (vga) selectdevice
  254. or
  255.     (epson) selectdevice
  256. As yet a third alternative, you can define an environment variable
  257. GS_DEVICE as the desired default device name.  The order of precedence for
  258. these alternatives, highest to lowest, is:
  259.     selectdevice
  260.     (command line)
  261.     GS_DEVICE
  262.     (first device in build list)
  263.  
  264. To select the density on a printer, use the shell command
  265.     gs -sDEVICE=<device> -r<xres>x<yres>
  266. For example, on a 9-pin Epson-compatible printer, you can get the
  267. lowest-density (fastest) mode with
  268.     gs -sDEVICE=epson -r60x72
  269. and the highest-density mode with
  270.     gs -sDEVICE=epson -r240x72.
  271. On a 24-pin printer, the lowest density is
  272.     gs -sDEVICE=epson -r60x60
  273. and the highest-density 24-pin mode is
  274.     gs -sDEVICE=epson -r360x180
  275.  
  276. If you select a printer as the output device, Ghostscript also allows you
  277. to control where the device sends its output.  Normally, output goes
  278. directly to the printer (PRN) on MS-DOS systems, and to a scratch file on
  279. Unix or VMS systems.  To send the output to a series of files foo1.xyz,
  280. foo2.xyz, ..., use the switch
  281.     -sOutputFile=foo%d.xyz
  282. (For compatibility with older versions of Ghostscript, -sOUTPUTFILE=
  283. also works.)  The %d is a printf format specification; you can use
  284. other formats like %02d.  Each file will receive one page of output.
  285. Alternatively, to send the output to a single file foo.xyz, with all
  286. the pages concatenated, use the switch
  287.     -sOutputFile=foo.xyz
  288.  
  289. On Unix systems, you can send the output directly to a pipe.  For
  290. example, to pipe the output to the command `lpr' (which, on many Unix
  291. systems, is the command that spools output for a printer), use the
  292. switch
  293.     -sOutputFile=\|lpr
  294. You can also send output to stdout for piping with the switch
  295.     -sOutputFile=-
  296. In this case you must also use the -q switch, to prevent Ghostscript from
  297. writing messages to stdout.
  298.  
  299. To find out what devices are available, type
  300.     devicenames ==
  301. after starting up Ghostscript.  Alternatively you can use the -h or
  302. -? switch in the command line, as described above.
  303.  
  304. Choosing paper size
  305. -------------------
  306.  
  307. Ghostscript is normally configured to expect U.S. letter paper.  To select
  308. a different paper size as the default, find the line in gs_init.ps that
  309. says
  310.  
  311.     % Optionally choose a default paper size other than U.S. letter.
  312.  
  313. The next line begins
  314.  
  315.     % (a4)
  316.  
  317. To select A4 as the default paper size, remove the % but do not change
  318. anything else.  To select a different default paper size, remove the % and
  319. replace the word a4 with the name of the desired paper size.  You can use
  320. any paper size listed in the table at the beginning of gs_statd.ps.
  321. (Individual documents can also specify a paper size, which will take
  322. precedence over the one specified on the command line.)
  323.  
  324. Alternatively, to select a different paper size for a single invocation of
  325. Ghostscript, you can use the command line switch
  326.     -sPAPERSIZE=a_known_paper_size
  327. e.g.,
  328.     -sPAPERSIZE=a4
  329. or
  330.     -sPAPERSIZE=legal
  331.  
  332. Finally, most (but not all) of Ghostscript's printer drivers can be
  333. configured at compile time to use A4 paper as the default by including
  334. -DA4 in the CFLAGS switches in the makefile.  See make.doc for more
  335. details.
  336.  
  337. File searching
  338. --------------
  339.  
  340. When looking for the initialization files (gs_*.ps), the files related to
  341. fonts, or the file for the 'run' operator, Ghostscript first checks whether
  342. the file name specifies an explicit directory or drive (i.e., doesn't begin
  343. with '/' on Unix systems; doesn't contain a ':' or begin with a '/' or '\'
  344. on MS-DOS systems; doesn't contain a ':' or a square bracket on VMS
  345. systems).  If it does, Ghostscript simply tries to open the file using the
  346. given name.  Otherwise, Ghostscript will try directories in the following
  347. order:
  348.  
  349.     - The directory/ies specified by the -I switch(es) in the command
  350.       line (see below), if any;
  351.  
  352.     - The directory/ies specified by the GS_LIB environment variable,
  353.       if any;
  354.  
  355.     - The directory/ies specified by the GS_LIB_DEFAULT macro in the
  356.       Ghostscript makefile, if any.
  357.  
  358. Each of these (GS_LIB_DEFAULT, GS_LIB, and -I parameter) may be either a
  359. single directory, or a list of directories separated by a character
  360. appropriate for the operating system (':' on Unix systems, ';' on VMS
  361. systems, ';' on MS-DOS systems).  Note that Ghostscript does *not* attempt
  362. to open the file in the current directory.  This is consistent with common
  363. practice on Unix, but it is different from the usual practice on MS-DOS.
  364.  
  365. When Ghostscript starts up, it also looks at the GS_FONTPATH environment
  366. variable, which is also a list of directories.  It goes to those
  367. directories and looks for all files that appear to contain PostScript
  368. fonts; it then effectively adds all those files and fonts to its internal
  369. copy of the Fontmap (the catalog of fonts and the files that contain
  370. them).  If you are using one of the following types of computer, you may
  371. wish to set GS_FONTPATH to the indicated value so that Ghostscript will
  372. automatically acquire all the installed Type 1 fonts:
  373.  
  374.     System type        GS_FONTPATH
  375.     -----------        -----------
  376.     AIX            /usr/lpp/DPS/fonts/outlines
  377.     NeXT            /NextLibrary/Fonts/outline
  378.     OSF/1            /usr/lib/X11/fonts/Type1Adobe
  379.     Silicon Graphics    /usr/lib/DPS/outline/base
  380.     Sun (Solaris 2.3)    /usr/openwin/lib/X11/fonts/Type1/outline
  381.     Ultrix            /usr/lib/DPS/outline/decwin
  382.  
  383. These paths may not be exactly right for your installation; if the
  384. indicated directory doesn't contain files whose names are familiar font
  385. names like Courier and Helvetica, you may wish to ask your system
  386. administrator where to find these fonts.
  387.  
  388. Temporary files
  389. ---------------
  390.  
  391. By default, Ghostscript creates temporary files named _temp_XX.XXX in the
  392. current directory on MS-DOS and VMS systems, gsXXXXXX in the current
  393. directory on OS/2 systems, and gs_XXXXX in the /tmp directory on Unix
  394. systems.  You can change the directory in which Ghostscript will create
  395. these files by setting the TEMP environment variable to the name of the
  396. directory.
  397.  
  398. Ghostscript currently doesn't do a very good job of deleting temporary
  399. files when it exits; you may have to delete them manually from time to
  400. time.
  401.  
  402. Environment variable summary
  403. ----------------------------
  404.  
  405. GS_DEVICE
  406.     Defines the default output device.  Described above.
  407.  
  408. GS_FONTPATH
  409.     Specifies a list of directories that should be scanned for fonts
  410. at startup.  Described above.
  411.  
  412. GS_LIB
  413.     Provides a search path for initialization files and fonts.
  414. Described above.
  415.  
  416. GS_OPTIONS
  417.     Defines a list of command line arguments to be processed before
  418. the ones actually specified on the command line.  For example, setting
  419. GS_DEVICE to xxx is equivalent to setting GS_OPTIONS to -sDEVICE=xxx.  The
  420. contents of GS_OPTIONS are not limited to switches; they may include
  421. actual file names or even @file arguments.
  422.  
  423. TEMP
  424.     Defines a directory name for temporary files.  Described above.
  425.  
  426. ********
  427. ******** Notes on specific platforms ********
  428. ********
  429.  
  430. VMS
  431. ---
  432.  
  433. On VMS systems, the last character of each "directory" name indicates what
  434. sort of entity the "directory" references.  If the "directory" name ends
  435. with a colon, it is taken as referring to a logical device, e.g.:
  436.     $ DEFINE GHOSTSCRIPT_DEVICE DUA1:[GHOSTSCRIPT_14]
  437.     $ DEFINE GS_LIB GHOSTSCRIPT_DEVICE:
  438. If the "directory" name ends with a closing square bracket, it is taken as
  439. referring to a real directory, e.g.:
  440.     $ DEFINE GS_LIB DUA1:[GHOSTSCRIPT]
  441.  
  442. To run Ghostscript with switches, you must type a command like
  443.  
  444.     $ gs "-dNODISPLAY"
  445.  
  446. because the C run time library will convert the command
  447. parameters/arguments to lowercase unless you enclose them in double quotes
  448. which preserves the case.
  449.  
  450. If you are on an X Windows display (for which gs is built), you can do
  451.  
  452.     $ set display/create/node="domain-name"/transport=tcpip
  453.  
  454. For example,
  455.  
  456.     $ set display/create/node="doof.city.com"/transport=tcpip
  457.  
  458. and then run Ghostscript
  459.  
  460.     $ gs
  461.  
  462. If you write printer output to a file and then want to print the file
  463. later, use the "/PASSALL" qualifier to the PRINT command.
  464.  
  465. MS-DOS
  466. ------
  467.  
  468. Ghostscript supports many SuperVGA displays directly, most of them with
  469. more than 16 colors.  The complete list is in the file devs.mak, which is
  470. part of the Ghostscript source code.  (If you got Ghostscript under the
  471. Aladdin Ghostscript Free Public License, the person or place from which you
  472. got it is also required to make the source code available to you; if you
  473. got it under the GNU License, see the GNU License for more information.)
  474.  
  475. If you are running Ghostscript on a MS-DOS machine with a display
  476. that is not EGA/VGA compatible, you must use the Borland compiler.
  477. You must build Ghostscript with the BGI driver as the default, and
  478. you will need the appropriate .BGI file from the Borland Turbo C
  479. library.  (Ghostscript includes the EGA/VGA driver in the
  480. executable.)
  481.  
  482. If you are using the BGI driver, two additional environment variables
  483. become relevant:
  484.  
  485.     BGIPATH - defines the directory where Ghostscript will look for
  486. the appropriate BGI driver.  If BGIPATH is not defined, Ghostscript will
  487. look in the directory defined as BGIDIR in the makefile.  In either case,
  488. if no driver is found in the designated directory, Ghostscript will look
  489. in the current directory.
  490.  
  491.     BGIUSER - a string of the form nn.dname, where nn is a hexadecimal
  492. number giving a display mode and dname is the name of a file containing a
  493. user-supplied BGI driver.  If BGIUSER is defined and the BGI device is
  494. selected, Ghostscript will supply nn as the display mode and will obtain
  495. the driver from the file named dname.
  496.  
  497. Some applications, such as Microsoft Word, require a prologue in front of
  498. the PostScript files they output.  In the case of Word, this is one of the
  499. *.ini files included with the Word distribution.  Other applications may
  500. require other prologues.  These may be specified on the Ghostscript
  501. command line, e.g.,
  502.     gs prologue.ini myfile.ps
  503.  
  504. X Windows
  505. ---------
  506.  
  507. Ghostscript looks for the following resources under the program name
  508. "ghostscript" and class name "Ghostscript":
  509.  
  510.     Name            Class            Default
  511.     ----            -----            -------
  512.     background        Background        white
  513.     foreground        Foreground        black
  514.     borderColor        BorderColor        black
  515.     borderWidth        BorderWidth        1
  516.     geometry        Geometry        NULL
  517.     xResolution        Resolution        **
  518.     yResolution        Resolution        **
  519.     useExternalFonts    UseExternalFonts    true
  520.     useScalableFonts    UseScalableFonts    true
  521.     logExternalFonts    LogExternalFonts    false
  522.     externalFontTolerance    ExternalFontTolerance    10.0
  523.     palette            Palette            Color
  524.     maxGrayRamp        MaxGrayRamp        128
  525.     maxRGBRamp        MaxRGBRamp        5
  526.     useBackingPixmap    UseBackingPixmap    true
  527.     useXPutImage        UseXPutImage        true
  528.     useXSetTile        UseXSetTile        true
  529.     regularFonts        RegularFonts        see below
  530.     symbolFonts        SymbolFonts        see below
  531.     dingbatFonts        DingbatFonts        see below
  532.  
  533. ** Calculated from display metrics.
  534.  
  535.     Notes on Resources:
  536.  
  537.     Ghostscript doesn't look at the default system background and
  538.     foreground colors; if you want to change the background or
  539.     foreground color, you must set them explicitly for Ghostscript.
  540.     (This is a deliberate choice, so that PostScript documents will
  541.     display correctly -- with white = white and black = black --
  542.     by default, even if text windows use other colors.)
  543.  
  544.     The geometry resource only affects window placement.
  545.  
  546.     Resolution is given in pixels per inch.
  547.  
  548.     The font tolerance gives largest acceptable difference in
  549.     height of the screen font.  The tolerance is expressed as
  550.     a percentage of the height of the desired font.
  551.  
  552.     The palette resource can be used to restrict ghostscript to
  553.     using a grayscale or monochrome palette.
  554.  
  555.     The maxRGBRamp and maxGrayRamp control the maximum number of
  556.     colors that ghostscript allocates ahead of time for the dither
  557.     cube/ramp.  Ghostscript will never preallocate more than half
  558.     of the cells in a colormap.
  559.  
  560. The use... resources exist primarily to work around bugs in X servers.
  561.  
  562.     Some servers do not implement backing pixmaps properly, or do not
  563.     have enough memory for them.  If you get strange behavior or "out
  564.     of memory" messages, try setting useBackingPixmap to false.
  565.  
  566.     Some servers do not implement tiling properly.  This will show up
  567.     as broad bands of color where dither patterns should appear.  If
  568.     this happens, try setting useXSetTile to false.
  569.  
  570.     Some servers do not implement bitmap/pixmap displaying properly.
  571.     This may show up as white or black rectangles where characters
  572.     should appear, or characters may appear in "inverse video" (e.g.,
  573.     white on a black rectangle).  If this happens, try setting
  574.     useXPutImage to false.
  575.  
  576. To use native X11 fonts, Ghostscript must map PostScript font names to
  577. the XLFD font names.  The regularFonts, symbolFonts, and dingbatFonts
  578. resources give the name mapping for different encodings.  The XLFD font 
  579. name in the mapping must contain seven dashes.  The X driver adds the
  580. additional size and encoding fields to bring the total number of dashes
  581. in the font name to 14.  Here are the default font mappings:
  582.  
  583.   Regular Fonts: (Fonts available in standard or ISO-Latin-1 encoding)
  584.  
  585.     AvantGarde-Book:-Adobe-ITC Avant Garde Gothic-Book-R-Normal--\n\
  586.     AvantGarde-BookOblique:-Adobe-ITC Avant Garde Gothic-Book-O-Normal--\n\
  587.     AvantGarde-Demi:-Adobe-ITC Avant Garde Gothic-Demi-R-Normal--\n\
  588.     AvantGarde-DemiOblique:-Adobe-ITC Avant Garde Gothic-Demi-O-Normal--\n\
  589.     Bookman-Demi:-Adobe-ITC Bookman-Demi-R-Normal--\n\
  590.     Bookman-DemiItalic:-Adobe-ITC Bookman-Demi-I-Normal--\n\
  591.     Bookman-Light:-Adobe-ITC Bookman-Light-R-Normal--\n\
  592.     Bookman-LightItalic:-Adobe-ITC Bookman-Light-I-Normal--\n\
  593.     Courier:-Adobe-Courier-Medium-R-Normal--\n\
  594.     Courier-Bold:-Adobe-Courier-Bold-R-Normal--\n\
  595.     Courier-BoldOblique:-Adobe-Courier-Bold-O-Normal--\n\
  596.     Courier-Oblique:-Adobe-Courier-Medium-O-Normal--\n\
  597.     Helvetica:-Adobe-Helvetica-Medium-R-Normal--\n\
  598.     Helvetica-Bold:-Adobe-Helvetica-Bold-R-Normal--\n\
  599.     Helvetica-BoldOblique:-Adobe-Helvetica-Bold-O-Normal--\n\
  600.     Helvetica-Narrow:-Adobe-Helvetica-Medium-R-Narrow--\n\
  601.     Helvetica-Narrow-Bold:-Adobe-Helvetica-Bold-R-Narrow--\n\
  602.     Helvetica-Narrow-BoldOblique:-Adobe-Helvetica-Bold-O-Narrow--\n\
  603.     Helvetica-Narrow-Oblique:-Adobe-Helvetica-Medium-O-Narrow--\n\
  604.     Helvetica-Oblique:-Adobe-Helvetica-Medium-O-Normal--\n\
  605.     NewCenturySchlbk-Bold:-Adobe-New Century Schoolbook-Bold-R-Normal--\n\
  606.     NewCenturySchlbk-BoldItalic:-Adobe-New Century Schoolbook-Bold-I-Normal--\n\
  607.     NewCenturySchlbk-Italic:-Adobe-New Century Schoolbook-Medium-I-Normal--\n\
  608.     NewCenturySchlbk-Roman:-Adobe-New Century Schoolbook-Medium-R-Normal--\n\
  609.     Palatino-Bold:-Adobe-Palatino-Bold-R-Normal--\n\
  610.     Palatino-BoldItalic:-Adobe-Palatino-Bold-I-Normal--\n\
  611.     Palatino-Italic:-Adobe-Palatino-Medium-I-Normal--\n\
  612.     Palatino-Roman:-Adobe-Palatino-Medium-R-Normal--\n\
  613.     Times-Bold:-Adobe-Times-Bold-R-Normal--\n\
  614.     Times-BoldItalic:-Adobe-Times-Bold-I-Normal--\n\
  615.     Times-Italic:-Adobe-Times-Medium-I-Normal--\n\
  616.     Times-Roman:-Adobe-Times-Medium-R-Normal--\n\
  617.     ZapfChancery-MediumItalic:-Adobe-ITC Zapf Chancery-Medium-I-Normal--
  618.  
  619.   Symbol Fonts:  (using Symbol encoding)
  620.  
  621.     Symbol: -Adobe-Symbol-Medium-R-Normal--
  622.  
  623.   Dingbat Fonts: (using Dingbat encoding)
  624.  
  625.     ZapfDingbats: -Adobe-ITC Zapf Dingbats-Medium-R-Normal--
  626.  
  627. For X11/NeWS, one can use the OpenWindows scalable fonts instead, which
  628. will give good quality output for any point size.  In this environment,
  629. the relevant section of the resource file should look like this:
  630.  
  631. Ghostscript.regularFonts: \
  632.     AvantGarde-Book:        -itc-avantgarde-book-r-normal-- \n\
  633.     AvantGarde-BookOblique:        -itc-avantgarde-book-o-normal-- \n\
  634.     AvantGarde-Demi:        -itc-avantgarde-demi-r-normal-- \n\
  635.     AvantGarde-DemiOblique:        -itc-avantgarde-demi-o-normal-- \n\
  636.     Bembo:                -monotype-bembo-medium-r-normal-- \n\
  637.     Bembo-Bold:            -monotype-bembo-bold-r-normal-- \n\
  638.     Bembo-BoldItalic:        -monotype-bembo-bold-i-normal-- \n\
  639.     Bembo-Italic:            -monotype-bembo-medium-i-normal-- \n\
  640.     Bookman-Demi:            -itc-bookman-demi-r-normal-- \n\
  641.     Bookman-DemiItalic:        -itc-bookman-demi-i-normal-- \n\
  642.     Bookman-Light:            -itc-bookman-light-r-normal-- \n\
  643.     Bookman-LightItalic:        -itc-bookman-light-i-normal-- \n\
  644.     Courier:            -itc-courier-medium-r-normal-- \n\
  645.     Courier-Bold:            -itc-courier-bold-r-normal-- \n\
  646.     Courier-BoldOblique:        -itc-courier-bold-o-normal-- \n\
  647.     Courier-Oblique:        -itc-courier-medium-o-normal-- \n\
  648.     GillSans:            -monotype-gill-medium-r-normal-sans- \n\
  649.     GillSans-Bold:            -monotype-gill-bold-r-normal-sans- \n\
  650.     GillSans-BoldItalic:        -monotype-gill-bold-i-normal-sans- \n\
  651.     GillSans-Italic:        -monotype-gill-normal-i-normal-sans- \n\
  652.     Helvetica:            -linotype-helvetica-medium-r-normal-- \n\
  653.     Helvetica-Bold:            -linotype-helvetica-bold-r-normal-- \n\
  654.     Helvetica-BoldOblique:        -linotype-helvetica-bold-o-normal-- \n\
  655.     Helvetica-Narrow:        -linotype-helvetica-medium-r-narrow-- \n\
  656.     Helvetica-Narrow-Bold:        -linotype-helvetica-bold-r-narrow-- \n\
  657.     Helvetica-Narrow-BoldOblique:    -linotype-helvetica-bold-o-narrow-- \n\
  658.     Helvetica-Narrow-Oblique:    -linotype-helvetica-medium-o-narrow-- \n\
  659.     Helvetica-Oblique:        -linotype-helvetica-medium-o-normal-- \n\
  660.     LucidaBright:            -b&h-lucidabright-medium-r-normal-- \n\
  661.     LucidaBright-Demi:        -b&h-lucidabright-demibold-r-normal-- \n\
  662.     LucidaBright-DemiItalic:    -b&h-lucidabright-demibold-i-normal-- \n\
  663.     LucidaBright-Italic:        -b&h-lucidabright-medium-i-normal-- \n\
  664.     LucidaSans:            -b&h-lucida-medium-r-normal-sans- \n\
  665.     LucidaSans-Bold:        -b&h-lucida-bold-r-normal-sans- \n\
  666.     LucidaSans-BoldItalic:        -b&h-lucida-bold-i-normal-sans- \n\
  667.     LucidaSans-Italic:        -b&h-lucida-medium-i-normal-sans- \n\
  668.     LucidaSans-Typewriter:        -b&h-lucidatypewriter-medium-r-normal-sans- \n\
  669.     LucidaSans-TypewriterBold:    -b&h-lucidatypewriter-bold-r-normal-sans- \n\
  670.     NewCenturySchlbk-BoldItalic:    -linotype-new century schoolbook-bold-i-normal-- \n\
  671.     NewCenturySchlbk-Bold:        -linotype-new century schoolbook-bold-r-normal-- \n\
  672.     NewCenturySchlbk-Italic:    -linotype-new century schoolbook-medium-i-normal-- \n\
  673.     NewCenturySchlbk-Roman:        -linotype-new century schoolbook-medium-r-normal-- \n\
  674.     Palatino-Bold:            -linotype-palatino-bold-r-normal-- \n\
  675.     Palatino-BoldItalic:        -linotype-palatino-bold-i-normal-- \n\
  676.     Palatino-Italic:        -linotype-palatino-medium-i-normal-- \n\
  677.     Palatino-Roman:            -linotype-palatino-medium-r-normal-- \n\
  678.     Rockwell:            -monotype-rockwell-medium-r-normal-- \n\
  679.     Rockwell-Bold:            -monotype-rockwell-bold-r-normal-- \n\
  680.     Rockwell-BoldItalic:        -monotype-rockwell-bold-i-normal-- \n\
  681.     Rockwell-Italic:        -monotype-rockwell-medium-i-normal-- \n\
  682.     Times-Bold:            -linotype-times-bold-r-normal-- \n\
  683.     Times-BoldItalic:        -linotype-times-bold-i-normal-- \n\
  684.     Times-Italic:            -linotype-times-medium-i-normal-- \n\
  685.     Times-Roman:            -linotype-times-medium-r-normal-- \n\
  686.     Utopia-Bold:            -adobe-utopia-bold-r-normal-- \n\
  687.     Utopia-BoldItalic:        -adobe-utopia-bold-i-normal-- \n\
  688.     Utopia-Italic:            -adobe-utopia-regular-i-normal-- \n\
  689.     Utopia-Regular:            -adobe-utopia-regular-r-normal-- \n\
  690.     ZapfChancery-MediumItalic:    -itc-zapfchancery-medium-i-normal-- \n
  691. Ghostscript.dingbatFonts: \
  692.     ZapfDingbats:            -itc-zapfdingbats-medium-r-normal--
  693. Ghostscript.symbolFonts: \
  694.     Symbol:                --symbol-medium-r-normal--
  695.  
  696. Users who switch regularly between different X servers may wish to use the
  697. '*' wild card in place of the foundry name (itc, monotype, linotype, b&h,
  698. or adobe); users who do not switch X servers should leave the explicit
  699. foundry in the name, since it speeds up font accessing.
  700.  
  701. To set these resources, put them in a file (such as ~/.Xdefaults) in the
  702. following form:
  703.  
  704. Ghostscript*geometry:    -0+0
  705. Ghostscript*xResolution: 72
  706. Ghostscript*yResolution: 72
  707.  
  708. Then load the defaults into the X server:
  709.  
  710. % xrdb -merge ~/.Xdefaults
  711.  
  712. Ghostscript will take advantage of the "HP XLFD Enhancements," if
  713. available, to use native X11 fonts for fonts that are anamorphically
  714. scaled, rotated, or mirrored.  If the user has installed these changes to
  715. their X or font server, they will automatically be used when appropriate.
  716.  
  717. ********
  718. ******** Switches
  719. ********
  720.  
  721. Unless otherwise noted, these apply to all platforms.
  722.  
  723. Normal switches
  724. ---------------
  725.  
  726.     @filename
  727.         Causes Ghostscript to read filename and treat its
  728.         contents the same as the command line.  (This is
  729.         intended primarily for getting around MS-DOS's
  730.         128-character limit on the length of a command line.)
  731.         Switches or file names in the file may be separated by
  732.         any amount of white space (space, tab, line break);
  733.         there is no limit on the size of the file.
  734.  
  735.     -- filename arg1 ...
  736.     -+ filename arg1 ...
  737.         Takes the next argument as a file name as usual, but takes
  738.         all remaining arguments (even if they have the syntactic
  739.         form of switches) and defines the name ARGUMENTS in
  740.         userdict (not systemdict) as an array of those strings,
  741.         *before* running the file.  When Ghostscript finishes
  742.         executing the file, it exits back to the shell.
  743.  
  744.     -@ filename arg1 ...
  745.         Does the same thing as -- and -+, but expands @filename
  746.         arguments.
  747.  
  748.     -c tokens ...
  749.         Interprets arguments, up to the next argument that begins
  750.         with - followed by a non-digit or with @, as PostScript
  751.         code.  For example, if the file quit.ps contains just
  752.         the word `quit', the following are equivalent:
  753.             quit.ps
  754.         and
  755.             -c quit
  756.         Each argument must be exactly one token, as defined by
  757.         the `token' operator.
  758.  
  759.     -Dname=token
  760.     -dname=token
  761.         Define a name in systemdict with the given definition.
  762.         The token must be exactly one token (as defined by the
  763.         'token' operator) and must not contain any whitespace.
  764.  
  765.     -Dname
  766.     -dname
  767.         Define a name in systemdict with value=true.
  768.  
  769.     -Sname=string
  770.     -sname=string
  771.         Define a name in systemdict with a given string as value.
  772.         This is different from -d.  For example,
  773.             -dname=35
  774.         is equivalent to the program fragment
  775.             /name 35 def
  776.         whereas
  777.             -sname=35
  778.         is equivalent to
  779.             /name (35) def
  780.  
  781.     -q
  782.         Quiet startup -- suppress normal startup messages,
  783.         and also do the equivalent of -dQUIET.
  784.  
  785.     -ffilename
  786.         Execute the given file, even if its name begins with a -
  787.         or an @.  -f alone does nothing, but it provides a
  788.         convenient way to terminate the list of tokens for the -c
  789.         switch.
  790.  
  791.     -gnumber1xnumber2
  792.         Equivalent to -dDEVICEWIDTH=number1 and
  793.         -dDEVICEHEIGHT=number2.  This is for the benefit of
  794.         devices (such as X11 windows and VESA displays) that require
  795.         (or allow) width and height to be specified.
  796.  
  797.     -rnumber
  798.     -rnumber1xnumber2
  799.         Equivalent to -dDEVICEXRESOLUTION=number1 and
  800.         -dDEVICEYRESOLUTION=number2.  This is for the benefit of
  801.         devices (such as printers) that support multiple
  802.         X and Y resolutions.
  803.  
  804.     -Idirectories
  805.         Adds the designated list of directories at the head of the
  806.         search path for library files.
  807.  
  808.     -
  809.         This is not really a switch.  It indicates to Ghostscript
  810.         that the standard input is coming from a file or a pipe.
  811.         Ghostscript reads from stdin until reaching end-of-file,
  812.         executing it like any other file, and then continues
  813.         processing the command line.  At the end of the command
  814.         line, Ghostscript exits rather than going into its
  815.         interactive mode.
  816.  
  817. Note that gs_init.ps makes systemdict read-only, so the values of names
  818. defined with -D/d/S/s cannot be changed (although, of course, they can be
  819. superseded by definitions in userdict or other dictionaries.)
  820.  
  821. Special names
  822. -------------
  823.  
  824. -dDISKFONTS
  825.     causes individual character outlines to be loaded from the disk
  826. the first time they are encountered.  (Normally Ghostscript loads all the
  827. character outlines when it loads a font.)  This may allow loading more
  828. fonts into RAM, at the expense of slower rendering.
  829.  
  830. -dNOBIND
  831.     disables the 'bind' operator.  Only useful for debugging.
  832.  
  833. -dNOCACHE
  834.     disables character caching.  Only useful for debugging.
  835.  
  836. -dNODISPLAY
  837.     suppresses the normal initialization of the output device.  This
  838. may be useful when debugging.
  839.  
  840. -dNOPAUSE
  841.     disables the prompt and pause at the end of each page.  This may
  842. be desirable for applications where another program is 'driving'
  843. Ghostscript.
  844.  
  845. -dNOPLATFONTS
  846.     disables the use of fonts supplied by the underlying platform
  847. (X Windows or Microsoft Windows).  This may be needed if the platform
  848. fonts look undesirably different from the scalable fonts.
  849.  
  850. -dSAFER
  851.     disables the deletefile and renamefile operators, and the
  852. ability to open files in any mode other than read-only.  This may be
  853. desirable for spoolers or other sensitive environments.
  854.  
  855. -dWRITESYSTEMDICT
  856.     leaves systemdict writable.  This is necessary when running
  857. special utility programs such as font2c and pcharstr, which must bypass
  858. normal PostScript access protection.
  859.  
  860. -sDEVICE=device
  861.     selects an alternate initial output device, as described above.
  862.  
  863. -sOutputFile=filename
  864.     selects an alternate output file (or pipe) for the initial output
  865. device, as described above.
  866.  
  867. Debugging switches
  868. ------------------
  869.  
  870. The -Z switch only applies if the interpreter was built for a
  871. debugging configuration (DEBUG=1 or -DDEBUG selected at compile
  872. time).
  873.  
  874.     -A    Fill empty storage with a distinctive bit pattern
  875.         for debugging.  Equivalent to -Z@.
  876.  
  877.     -E    Turn on tracing of error returns from operators.
  878.         Equivalent to -Z#.
  879.  
  880.     -Mn    Force the interpreter's allocator to acquire additional
  881.         memory in units of nK, rather than the default (currently
  882.         20K on MS-DOS systems, 50K on Unix).  n is a positive
  883.         decimal integer (not exceeding 63 on MS-DOS systems).
  884.  
  885.     -Zxxx    Turn on debugging printout.
  886.         Each of the xxx characters selects an option.
  887.         Case is significant.
  888.             0 = OS-related calls
  889.             1 = type 1 font interpreter (type1addpath)
  890.             2 = curve subdivider/rasterizer
  891.               3 = curve subdivider/rasterizer, detail
  892.             4 = garbage collector (strings)
  893.               5 = garbage collector (strings, detail)
  894.             6 = garbage collector (chunks, roots)
  895.               7 = garbage collector (objects)
  896.               8 = garbage collector (refs)
  897.               9 = garbage collector (pointers)
  898.             a = allocator (large blocks only)
  899.               A = allocator (all calls)
  900.             b = bitmap image processor
  901.               B = bitmap images, detail
  902.             c = color/halftone mapper
  903.             d = dictionary put/undef
  904.               D = dictionary lookups
  905.             f = fill algorithm (summary)
  906.               F = fill algorithm (detail)
  907.             g = gsave/grestore[all]
  908.             h = halftone renderer
  909.               H = halftones, every pixel
  910.             i = interpreter, just names
  911.               I = interpreter, everything
  912.             j = (Japanese) composite fonts
  913.             k = character cache & xfonts
  914.               K = character cache, every access
  915.             l = command lists, bands
  916.               L = command lists, everything
  917.             m = makefont and font cache
  918.             n = name lookup (new names only)
  919.             o = outliner (stroke)
  920.               O = stroke detail
  921.             p = path tracer
  922.             q = clipping
  923.             r = arc renderer
  924.             s = streams
  925.               S = scanner
  926.             t = tiling algorithm
  927.             u = undo saver (for save/restore)
  928.               U = undo saver, more detail
  929.             v = rectangle fill
  930.               V = device-level output
  931.             w = compression encoder/decoder
  932.             x = transformations
  933.             y = Type 1 hints
  934.               Y = Type 1 hints, every access
  935.             z = trapezoid fill
  936.             # = operator error returns
  937.         The following switches select debugging options other than
  938.         printout.
  939.             + = use minimum-size stack blocks
  940.             @ = clear storage when allocating or freeing
  941.  
  942. ********
  943. ******** Frequently Asked Questions
  944. ********
  945.  
  946. Q: The spacing of characters / words / margins on the display is
  947. wrong, what can I do?
  948.  
  949. A: This is almost always caused by differences between the character
  950. widths that were used to format the document and the character widths
  951. of the fonts installed in your system.  (This only affects the
  952. display, and only with window systems, not with MS-DOS.)  If this
  953. happens, invoke Ghostscript with the -dNOPLATFONTS switch, or (on X
  954. Windows) set
  955.     Ghostscript*useExternalFonts: false
  956. in your X resource file.
  957.  
  958. For more information about fonts on the display, please read the
  959. first sections of fonts.doc.
  960.  
  961. Q: On my H-P LaserJet, why do I only get a partial page of output, or a
  962. single page gets split across two sheets?
  963.  
  964. A: Printing on a Hewlett-Packard LaserJet at full resolution (300 DPI)
  965. requires a printer with at least 1.5 Mb of memory.  150 DPI printing
  966. requires only .5 Mb.  You can select 150 DPI printing with the command
  967. line switch
  968.     -r150
  969. (This is not necessary on DeskJet printers.)
  970.  
  971. Q: On my MS-DOS system using GS.EXE (Borland compiler), why do I get a
  972. `limitcheck in setdevice' or `VMerror in setdevice' error message?
  973.  
  974. A: On MS-DOS systems using the Borland compiler, if Ghostscript gives you
  975. a 'limitcheck in setdevice' error, it may mean Ghostscript's standard
  976. buffer size wasn't large enough.  Likewise, if Ghostscript gives you a
  977. 'VMerror in setdevice' error, it means the buffer size was too large.  You
  978. can use the -dBufferSpace= switch to set the buffer size to a different
  979. value, e.g.,
  980.     -dBufferSpace=50000
  981. The default value is 25000; the smallest value Ghostscript accepts is
  982. 10000; the largest valid value is 65000.
  983.