File: use.doc

package info (click to toggle)
gs 3.33-7
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 7,436 kB
  • ctags: 15,511
  • sloc: ansic: 92,150; asm: 684; sh: 486; makefile: 91
file content (1086 lines) | stat: -rw-r--r-- 43,280 bytes parent folder | download
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
   Copyright (C) 1989, 1995 Aladdin Enterprises.  All rights reserved.
  
  This file is part of GNU Ghostscript.
  
  GNU Ghostscript is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility to
  anyone for the consequences of using it or for whether it serves any
  particular purpose or works at all, unless he says so in writing.  Refer
  to the GNU Ghostscript General Public License for full details.
  

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

This file, use.doc, describes how to use the Ghostscript language
interpreter.

For an overview of Ghostscript and a list of the documentation files, see
README.  

********
******** How to install Ghostscript ********
********

To run Ghostscript, you need the executable program, and also some
external initialization files:
	gs_*.ps (see psfiles.doc for the full list), unless Ghostscript was
	  compiled using the "compiled initialization files" option
	Fontmap

The file name of the executable program depends on the environment;
see the instructions for the specific platforms below.

The Ghostscript fileset includes a set of fonts (.gsf files); you should
have them on line as well, unless you have a complete set of other fonts
(such as ATM or Display PostScript fonts) and are using a Fontmap and/or
GS_FONTPATH that references them.

VMS
---

Installing Ghostscript on a VMS system requires compiling it first.  The
name of the executable is GS.EXE.

You should install all the files, including the fonts, in the same
directory as the executable and initialization files.  By default, this is
the directory in which you did the compilation.  Consult the command file
(VMS*.MAK) for more details.

If you have DECWindows/Motif installed, you may wish to replace the FONTMAP
file with the file FONTMAP.VMS.  Read the comment at the beginning of the
latter file for more information.

MS-DOS
------

There are two MS-DOS executables in the standard Ghostscript
distribution:
	- GS.EXE runs on any MS-DOS machine, but is limited to 640K.
	- GS386.EXE runs on any 386 or 486 machine, and will use all
available extended (not expanded) memory.

You should install all the files except the fonts in C:\GS, and the
fonts in C:\GS\FONTS.

If you have Adobe Type Manager fonts installed on your system, and you wish
to use them with Ghostscript, you may wish to replace the FONTMAP file with
FONTMAP.ATM, and to add to the environment variable GS_LIB the name of the
directory where the fonts are located (see below for more information about
GS_LIB).  Before you do this, please read carefully the license that
accompanies the ATM fonts; Aladdin Enterprises takes no responsibility for
any possible violations of such licenses.  Similarly, if you have Adobe
Type Basics, you may wish to replace FONTMAP with FONTMAP.ATB.

MS Windows
----------

The name of the executable is GSWIN.EXE.  Ghostscript probably requires
Windows 3.1, and you must run Windows in 386 Enhanced or Standard (not
Real) mode.  Since Ghostscript is a large program, you will need to run
Windows in Enhanced mode (so that it can provide virtual memory) unless
you have at least 6 Mb of RAM.

You should install all the files except the fonts in C:\GS, and the fonts
in C:\GS\FONTS.

See under "MS-DOS" above for information about using Adobe Type Manager
fonts with Ghostscript.

The files COMMDLG.DLL and SHELL.DLL supplied with Ghostscript are only for
use with Windows 3.0.  If you have Windows 3.1, delete these files, since
Windows itself provides versions of them.

If your system uses TrueType fonts, you can get them converted to a
Ghostscript-compatible format at the time you select your "printer" by
doing the following:

1)	Open control panel and double click on the printers icon.
2)	Select your Postscript Printer.
3)	Choose Setup.
4)	Choose Options.
5)	Choose Advanced.
6)	At the top of the Dialog Box you will see TrueType Fonts
	Send to Printer As: <drop down menu>
	Choose Adobe Type 1.
7)	Uncheck Use Printer Fonts for All TrueType Fonts
	and Use Substitution Table.
8)	OK.
9)	OK etc.

That's it!  Your TrueType fonts will automatically be downloaded in your
PostScript file for Ghostscript to use.

OS/2 2.x
--------

The Ghostscript OS/2 implementation is designed for OS/2 2.1.  A few people
have used it successfully under OS/2 2.0, but it has had very little
testing.

The name of the executable is GSOS2.EXE.  This is a text application that
will run windowed or full screen.  The default device is "os2pm" which
displays output in a Presentation Manager window using the external driver
GSPMDRV.EXE.  GSPMDRV.EXE must be located in the same directory as
GSOS2.EXE or on the PATH.

GSOS2.EXE and GSPMDRV.EXE are compiled using EMX/GCC 0.8h.  You must have
the EMX DLL's on your LIBPATH.  These are available from
ftp.cdrom.com:pub/os2/2_x/unix/gnu/emx08h/emxrt.zip.

The system menu of the Ghostscript Image window includes a "Copy" command
to copy the currently displayed bitmap to the Clipboard.

OS/2 comes with some Adobe Type Manager fonts. If you wish to use these
with Ghostscript, you should replace the FONTMAP file with FONTMAP.OS2,
and add to the environment variable GS_LIB the name of the directory where
the fonts are located, usually c:\psfonts.  (see below for more
information about GS_LIB).  Before you do this, please read carefully the
license that accompanies the ATM fonts; Aladdin Enterprises takes no
responsibility for any possible violations of such licenses.

Since GSOS2.EXE is not a PM application, it cannot determine the depth of
the PM display.  You must provide this information using the
-dBitsPerPixel option.  The default is 8 bits/pixel.  Valid values are 1,
4, 8, 16 & 24.
  For monochrome VGA use      -dBitsPerPixel=1
  For standard VGA screen use -dBitsPerPixel=4
  For 256 colour SVGA use     -dBitsPerPixel=8
A command file gspm.cmd containing the following line may be useful:
  @c:\gs\gsos2.exe -Ic:/gs;c:/gs/fonts;c:/psfonts -sDEVICE=os2pm 
      -dBitsPerPixel=8 -sPAPERSIZE=a4 %1 %2 %3 %4 %5 %6 %7 %8

While drawing, the os2pm driver updates the display every 5 seconds.  On
slow computers this is undesirable and a different interval can be
specified in milliseconds with the -dUpdateInterval option.  The default
is -dUpdateInterval=5000; to disable update use -dUpdateInterval=0.

Standard VGA is very slow due to double buffering to avoid bugs and due to
1 plane to 4 plane conversion.  Use a 256 color display driver by
preference.  Many display drivers have bugs which cause 1 bit/pixel
bitmaps to be displayed incorrectly.

GSOS2.EXE and GSPMDRV.EXE will stay in memory for the number of minutes
specified in the environment variable GS_LOAD.

Ghostscript can also be run in a DOS box.  Please read the MS-DOS notes, 
since they apply to this environment as well.

If you run GS386 in the OS/2 2.0 or 2.1 DOS Box, you must select the
"ENABLED" setting for the DPMI_DOS_API option of the DOS Box.  GS386
will not run with the "AUTO" setting.

Unix
----

Installing Ghostscript on a Unix system requires compiling it first.
The name of the executable is gs.  The makefile installs all the
files, except the fonts, in /usr/local or various subdirectories
thereof.  The fonts should be installed in
/usr/local/lib/ghostscript/fonts.  Consult the makefile for more
details.

********
******** Shell scripts for Ghostscript
********

The Ghostscript distribution includes several Unix shell scripts for
driving Ghostscript in different environments.  These are all
user-contributed code: please contact the user identified in the file, not
Aladdin Enterprises, if you have questions.

> pv.sh - preview a specified page of a dvi file in an X window.

> sysvlp.sh - System V 3.2 lp interface for parallel printer.

> pj-gs.sh - printing on an H-P PaintJet under HP-UX.

> unix-lpr.sh - queue filter for lpr under Unix.
> lprsetup.sh - setup for unix-lpr.sh.

If one of these serves your needs, you may be able to skip most of
the rest of this document.

********
******** How to use Ghostscript ********
********

To invoke the interpreter, give the command
	gs <filename1> ... <filenameN>
The interpreter will read in the files in sequence and execute them.
After doing this, it reads further input from the primary input stream
(normally the keyboard).  Each line (i.e. characters up to a <return>) is
interpreted separately.  To exit from the interpreter, type quit<return>.
The interpreter also exits gracefully if it encounters end-of-file.
Typing the interrupt character, e.g., control-C, is also safe.

The interpreter recognizes several switches described below, which may appear
anywhere in the command line and apply to all files thereafter.

You can get a brief help message by invoking Ghostscript with
	gs -h
or
	gs -?
This message also lists the available devices.  For a little more
information about available devices, a one-line description of each device
appears near the beginning of the file devs.mak.

Choosing the output device
--------------------------

Ghostscript may be built with multiple output devices.  Ghostscript
normally opens the first one and directs output to it.  To use device xyz
as the initial output device, include the switch
	-sDEVICE=xyz
in the command line.  Note that this switch must precede the first .ps
file, and only its first invocation has any effect.  For example, for
printer output in a normal configuration that includes an Epson printer
driver, you might use the shell command
	gs -sDEVICE=epson myfile.ps
instead of just
	gs myfile.ps
Alternatively, once you are inside Ghostscript, you can type
	(epson) selectdevice
	(myfile.ps) run
All output then goes to the printer instead of the display until further
notice.  You can switch devices at any time by using the selectdevice
procedure, e.g.,
	(vga) selectdevice
or
	(epson) selectdevice
As yet a third alternative, you can define an environment variable
GS_DEVICE as the desired default device name.  The order of precedence for
these alternatives, highest to lowest, is:
	selectdevice
	(command line)
	GS_DEVICE
	(first device in build list)

To select the resolution on a printer, use the shell command
	gs -sDEVICE=<device> -r<xres>x<yres>
For example, on a 9-pin Epson-compatible printer, you can get the
lowest-resolution (fastest) mode with
	gs -sDEVICE=epson -r60x72
and the highest-resolution mode with
	gs -sDEVICE=epson -r240x72.
On a 24-pin printer, the lowest resolution is
	gs -sDEVICE=epson -r60x60
and the highest-resolution 24-pin mode is
	gs -sDEVICE=epson -r360x180

If you select a printer as the output device, Ghostscript also allows you
to control where the device sends its output.  Normally, output goes
directly to the printer (PRN) on MS-DOS systems, and to a scratch file on
Unix or VMS systems.  To send the output to a series of files foo1.xyz,
foo2.xyz, ..., use the switch
	-sOutputFile=foo%d.xyz
(For compatibility with older versions of Ghostscript, -sOUTPUTFILE=
also works.)  The %d is a printf format specification; you can use
other formats like %02d.  Each file will receive one page of output.
Alternatively, to send the output to a single file foo.xyz, with all
the pages concatenated, use the switch
	-sOutputFile=foo.xyz

On Unix systems, you can send the output directly to a pipe.  For
example, to pipe the output to the command `lpr' (which, on many Unix
systems, is the command that spools output for a printer), use the
switch
	-sOutputFile=\|lpr
You can also send output to stdout for piping with the switch
	-sOutputFile=-
In this case you must also use the -q switch, to prevent Ghostscript from
writing messages to stdout.

File formats like PCX and PBM are also 'devices'.  When you select a file
format as the 'device', you must also specify an output file, e.g.,
	gs -sDEVICE=pcxmono -sOutputFile=xyz.pcx

To find out what devices are available, type
	devicenames ==
after starting up Ghostscript.  Alternatively you can use the -h or
-? switch in the command line, as described above.

Choosing paper size
-------------------

Ghostscript is normally configured to expect U.S. letter paper.  To select
a different paper size as the default, find the line in gs_init.ps that
says

	% Optionally choose a default paper size other than U.S. letter.

The next line begins

	% (a4)

To select A4 as the default paper size, remove the % but do not change
anything else.  To select a different default paper size, remove the % and
replace the word a4 with the name of the desired paper size.  You can use
any paper size listed in the table at the beginning of gs_statd.ps.
(Individual documents can also specify a paper size, which will take
precedence over the one specified on the command line.)

Alternatively, to select a different paper size for a single invocation of
Ghostscript, you can use the command line switch
	-sPAPERSIZE=a_known_paper_size
e.g.,
	-sPAPERSIZE=a4
or
	-sPAPERSIZE=legal

Finally, most (but not all) of Ghostscript's printer drivers can be
configured at compile time to use A4 paper as the default by including
-DA4 in the CFLAGS switches in the makefile.  See make.doc for more
details.

File searching
--------------

When looking for the initialization files (gs_*.ps), the files related to
fonts, or the file for the 'run' operator, Ghostscript first checks whether
the file name specifies an explicit directory or drive (i.e., doesn't begin
with '/' on Unix systems; doesn't contain a ':' or begin with a '/' or '\'
on MS-DOS systems; doesn't contain a ':' or a square bracket on VMS
systems).  If it does, Ghostscript simply tries to open the file using the
given name.  Otherwise, Ghostscript will try directories in the following
order:

	- The current directory;

	- The directory/ies specified by the -I switch(es) in the command
	  line (see below), if any;

	- The directory/ies specified by the GS_LIB environment variable,
	  if any;

	- The directory/ies specified by the GS_LIB_DEFAULT macro in the
	  Ghostscript makefile, if any.

Each of these (GS_LIB_DEFAULT, GS_LIB, and -I parameter) may be either a
single directory, or a list of directories separated by a character
appropriate for the operating system (':' on Unix systems, ';' on VMS
systems, ';' on MS-DOS systems).  We think that trying the current
directory first is a very bad idea -- it opens serious security loopholes
and can lead to very confusing errors if one has more than one version of
Ghostscript in one's environment -- but when we attempted to change it,
users insisted that we change it back.

When Ghostscript starts up, it also looks at the GS_FONTPATH environment
variable, which is also a list of directories.  It goes to those
directories and looks for all files that appear to contain PostScript
fonts; it then effectively adds all those files and fonts to its internal
copy of the Fontmap (the catalog of fonts and the files that contain
them).  If you are using one of the following types of computer, you may
wish to set GS_FONTPATH to the indicated value so that Ghostscript will
automatically acquire all the installed Type 1 fonts:

	System type		GS_FONTPATH
	-----------		-----------
	AIX			/usr/lpp/DPS/fonts/outlines
	NeXT			/NextLibrary/Fonts/outline
	OSF/1			/usr/lib/X11/fonts/Type1Adobe
	Silicon Graphics	/usr/lib/DPS/outline/base
	Sun (Solaris 2.3)	/usr/openwin/lib/X11/fonts/Type1/outline
	Ultrix			/usr/lib/DPS/outline/decwin

These paths may not be exactly right for your installation; if the
indicated directory doesn't contain files whose names are familiar font
names like Courier and Helvetica, you may wish to ask your system
administrator where to find these fonts.

Temporary files
---------------

By default, Ghostscript creates temporary files named _temp_XX.XXX in the
current directory on MS-DOS and VMS systems, gsXXXXXX in the current
directory on OS/2 systems, and gs_XXXXX in the /tmp directory on Unix
systems.  You can change the directory in which Ghostscript will create
these files by setting the TEMP environment variable to the name of the
directory.

Ghostscript currently doesn't do a very good job of deleting temporary
files when it exits; you may have to delete them manually from time to
time.

Environment variable summary
----------------------------

GS_DEVICE
	Defines the default output device.  Described above.

GS_FONTPATH
	Specifies a list of directories that should be scanned for fonts
at startup.  Described above.

GS_LIB
	Provides a search path for initialization files and fonts.
Described above.

GS_OPTIONS
	Defines a list of command line arguments to be processed before
the ones actually specified on the command line.  For example, setting
GS_DEVICE to xxx is equivalent to setting GS_OPTIONS to -sDEVICE=xxx.  The
contents of GS_OPTIONS are not limited to switches; they may include
actual file names or even @file arguments.

TEMP
	Defines a directory name for temporary files.  Described above.

********
******** Notes on specific platforms ********
********

VMS
---

On VMS systems, the last character of each "directory" name indicates what
sort of entity the "directory" references.  If the "directory" name ends
with a colon, it is taken as referring to a logical device, e.g.:
	$ DEFINE GHOSTSCRIPT_DEVICE DUA1:[GHOSTSCRIPT_14]
	$ DEFINE GS_LIB GHOSTSCRIPT_DEVICE:
If the "directory" name ends with a closing square bracket, it is taken as
referring to a real directory, e.g.:
	$ DEFINE GS_LIB DUA1:[GHOSTSCRIPT]

To run Ghostscript with switches, you must type a command like

	$ gs "-dNODISPLAY"

because the C run time library will convert the command
parameters/arguments to lowercase unless you enclose them in double quotes
which preserves the case.

If you are on an X Windows display (for which gs is built), you can do

	$ set display/create/node="domain-name"/transport=tcpip

For example,

	$ set display/create/node="doof.city.com"/transport=tcpip

and then run Ghostscript

	$ gs

If you write printer output to a file and then want to print the file
later, use the "/PASSALL" qualifier to the PRINT command.

In order to get PDF files (or PostScript files that use the setfileposition
operator) to work properly on VMS systems, you must ensure that they are
"stream LF" type files.  If you transfer files by FTP, you probably need to
do one of the following two things after the transfer:

1. If FTP'd in text/ASCII mode then do:

     $ CONVERT/FDL=STREAMLF.FDL input-file output-file

   where the contents of the file STREAMLF.FDL are given below.

2. Otherwise, if FTP'd in binary mode do

     $ SET FILE/ATTRIBUTE=(RFM:STMLF)

The contents of the STREAMLF.FDL file are shown between, and exclusive of, the
dashed lines:

-------------------------------------------------
FILE
        ORGANIZATION            sequential

RECORD
        BLOCK_SPAN              yes
        CARRIAGE_CONTROL        carriage_return
        FORMAT                  stream_lf
-------------------------------------------------

MS-DOS
------

Ghostscript supports many SuperVGA displays directly, most of them with
more than 16 colors.  The complete list is in the file devs.mak, which is
part of the Ghostscript source code.  (If you got Ghostscript under the
Aladdin Ghostscript Free Public License, the person or place from which you
got it is also required to make the source code available to you; if you
got it under the GNU License, see the GNU License for more information.)

If you have a SuperVGA display that supports a 16-color mode with 800x600
pixels, and you know the display mode number for this mode, you can select
it by using the command line switches
	-sDEVICE=svga16 -dDisplayMode=NNN
where NNN is the display mode number in decimal.  The modes for some
popular display chipsets are as follows:

    Acumos AVGA2, AVGA3                         88	(0x58)
    Advance Logic AL2101                        43	(0x2B)
    Ahead V5000                                 113	(0x71)
    ATI VGAWONDER, Graphics Ultra etc.          84	(0x54)
    Chips and Technologies                      106	(0x6A)
    Cirrus Logic CL-GD 500/600                  100	(0x64)
    Cirrus Logic GD 5422                        88	(0x58)
    Compaq VGA                                  89	(0x59)
    CTI                                         106	(0x6A)
  * Genoa 5xxx, Sigma VGA                       41	(0x29)
    Genoa 6xxx                                  106	(0x6A)
    MXIC MX 68010                               85	(0x55)
    NCR 77C22                                   88	(0x58)
    OAK Technologies OTI-067, OTI-077, OTI037C  82	(0x52)
    OAK Technologies OTI037C w/ NEL BIOS        91	(0x5B)
  * Orchid Prodesigner                          41	(0x29)
    Paradise                                    88	(0x58)
    Poach                                       106	(0x6A)
    Primus                                      42	(0x2A)
    Realtek RT 3106                             31	(0x1F)
    Tecmar                                      22	(0x16)
    Trident 8900                                91	(0x5B)
  * Tseng ET-3000, ET-4000                      41	(0x29)
  * VEGA                                        41	(0x29)
    Video 7 SVGA                                98	(0x62)
    WD90C11                                     92	(0x5C)
    Western Digital                             88	(0x58)

The ones marked * are the default (they all use the same value.)  If your
card's chipset doesn't appear on this list, or if you try the value here
and it doesn't work, please e-mail the chipset and correct display mode to
ghost@aladdin.com for inclusion in future releases.

If you are running Ghostscript on a MS-DOS machine with a display that is
not EGA/VGA compatible, you must use the Borland compiler.  You must build
Ghostscript with the BGI driver as the default, and you will need the
appropriate .BGI file from the Borland Turbo C library.  (Ghostscript
includes the EGA/VGA driver in the executable.)

If you are using the BGI driver, two additional environment variables
become relevant:

	BGIPATH - defines the directory where Ghostscript will look for
the appropriate BGI driver.  If BGIPATH is not defined, Ghostscript will
look in the directory defined as BGIDIR in the makefile.  In either case,
if no driver is found in the designated directory, Ghostscript will look
in the current directory.

	BGIUSER - a string of the form nn.dname, where nn is a hexadecimal
number giving a display mode and dname is the name of a file containing a
user-supplied BGI driver.  If BGIUSER is defined and the BGI device is
selected, Ghostscript will supply nn as the display mode and will obtain
the driver from the file named dname.

Some applications, such as Microsoft Word, require a prologue in front of
the PostScript files they output.  In the case of Word, this is one of the
*.ini files included with the Word distribution.  Other applications may
require other prologues.  These may be specified on the Ghostscript
command line, e.g.,
	gs prologue.ini myfile.ps

X Windows
---------

Ghostscript looks for the following resources under the program name
"ghostscript" and class name "Ghostscript":

	Name			Class			Default
	----			-----			-------
	background		Background		white
	foreground		Foreground		black
	borderColor		BorderColor		black
	borderWidth		BorderWidth		1
	geometry		Geometry		NULL
	xResolution		Resolution		**
	yResolution		Resolution		**
	useExternalFonts	UseExternalFonts	true
	useScalableFonts	UseScalableFonts	true
	logExternalFonts	LogExternalFonts	false
	externalFontTolerance	ExternalFontTolerance	10.0
	palette			Palette			Color
	maxGrayRamp		MaxGrayRamp		128
	maxRGBRamp		MaxRGBRamp		5
        maxDynamicColors	MaxDynamicColors	256
	useBackingPixmap	UseBackingPixmap	true
	useXPutImage		UseXPutImage		true
	useXSetTile		UseXSetTile		true
	regularFonts		RegularFonts		see below
	symbolFonts		SymbolFonts		see below
	dingbatFonts		DingbatFonts		see below

** Calculated from display metrics.

    Notes on Resources:

	Ghostscript doesn't look at the default system background and
	foreground colors; if you want to change the background or
	foreground color, you must set them explicitly for Ghostscript.
	(This is a deliberate choice, so that PostScript documents will
	display correctly -- with white = white and black = black --
	by default, even if text windows use other colors.)

	The geometry resource only affects window placement.

	Resolution is given in pixels per inch.

	The font tolerance gives largest acceptable difference in
	height of the screen font.  The tolerance is expressed as
	a percentage of the height of the desired font.

	The palette resource can be used to restrict ghostscript to
	using a grayscale or monochrome palette.

	The maxRGBRamp and maxGrayRamp control the maximum number of
	colors that ghostscript allocates ahead of time for the dither
	cube/ramp.  Ghostscript will never preallocate more than half
	of the cells in a colormap.  maxDynamicColors controls the
	maximum number of colors that Ghostscript will allocate
	dynamically in the colormap.

The use... resources exist primarily to work around bugs in X servers.  In
particular, many versions of DEC's X server (DECwindows) have bugs that
require setting useXPutImage or useXSetTile to false.

	Some servers do not implement backing pixmaps properly, or do not
	have enough memory for them.  If you get strange behavior or "out
	of memory" messages, try setting useBackingPixmap to false.

	Some servers do not implement tiling properly.  This will show up
	as broad bands of color where dither patterns should appear.  If
	this happens, try setting useXSetTile to false.

	Some servers do not implement bitmap/pixmap displaying properly.
	This may show up as white or black rectangles where characters
	should appear, or characters may appear in "inverse video" (e.g.,
	white on a black rectangle).  If this happens, try setting
	useXPutImage to false.

To use native X11 fonts, Ghostscript must map PostScript font names to
the XLFD font names.  The regularFonts, symbolFonts, and dingbatFonts
resources give the name mapping for different encodings.  The XLFD font 
name in the mapping must contain seven dashes.  The X driver adds the
additional size and encoding fields to bring the total number of dashes
in the font name to 14.  Here are the default font mappings:

  Regular Fonts: (Fonts available in standard or ISO-Latin-1 encoding)

    AvantGarde-Book:-Adobe-ITC Avant Garde Gothic-Book-R-Normal--\n\
    AvantGarde-BookOblique:-Adobe-ITC Avant Garde Gothic-Book-O-Normal--\n\
    AvantGarde-Demi:-Adobe-ITC Avant Garde Gothic-Demi-R-Normal--\n\
    AvantGarde-DemiOblique:-Adobe-ITC Avant Garde Gothic-Demi-O-Normal--\n\
    Bookman-Demi:-Adobe-ITC Bookman-Demi-R-Normal--\n\
    Bookman-DemiItalic:-Adobe-ITC Bookman-Demi-I-Normal--\n\
    Bookman-Light:-Adobe-ITC Bookman-Light-R-Normal--\n\
    Bookman-LightItalic:-Adobe-ITC Bookman-Light-I-Normal--\n\
    Courier:-Adobe-Courier-Medium-R-Normal--\n\
    Courier-Bold:-Adobe-Courier-Bold-R-Normal--\n\
    Courier-BoldOblique:-Adobe-Courier-Bold-O-Normal--\n\
    Courier-Oblique:-Adobe-Courier-Medium-O-Normal--\n\
    Helvetica:-Adobe-Helvetica-Medium-R-Normal--\n\
    Helvetica-Bold:-Adobe-Helvetica-Bold-R-Normal--\n\
    Helvetica-BoldOblique:-Adobe-Helvetica-Bold-O-Normal--\n\
    Helvetica-Narrow:-Adobe-Helvetica-Medium-R-Narrow--\n\
    Helvetica-Narrow-Bold:-Adobe-Helvetica-Bold-R-Narrow--\n\
    Helvetica-Narrow-BoldOblique:-Adobe-Helvetica-Bold-O-Narrow--\n\
    Helvetica-Narrow-Oblique:-Adobe-Helvetica-Medium-O-Narrow--\n\
    Helvetica-Oblique:-Adobe-Helvetica-Medium-O-Normal--\n\
    NewCenturySchlbk-Bold:-Adobe-New Century Schoolbook-Bold-R-Normal--\n\
    NewCenturySchlbk-BoldItalic:-Adobe-New Century Schoolbook-Bold-I-Normal--\n\
    NewCenturySchlbk-Italic:-Adobe-New Century Schoolbook-Medium-I-Normal--\n\
    NewCenturySchlbk-Roman:-Adobe-New Century Schoolbook-Medium-R-Normal--\n\
    Palatino-Bold:-Adobe-Palatino-Bold-R-Normal--\n\
    Palatino-BoldItalic:-Adobe-Palatino-Bold-I-Normal--\n\
    Palatino-Italic:-Adobe-Palatino-Medium-I-Normal--\n\
    Palatino-Roman:-Adobe-Palatino-Medium-R-Normal--\n\
    Times-Bold:-Adobe-Times-Bold-R-Normal--\n\
    Times-BoldItalic:-Adobe-Times-Bold-I-Normal--\n\
    Times-Italic:-Adobe-Times-Medium-I-Normal--\n\
    Times-Roman:-Adobe-Times-Medium-R-Normal--\n\
    ZapfChancery-MediumItalic:-Adobe-ITC Zapf Chancery-Medium-I-Normal--

  Symbol Fonts:  (using Symbol encoding)

    Symbol: -Adobe-Symbol-Medium-R-Normal--

  Dingbat Fonts: (using Dingbat encoding)

    ZapfDingbats: -Adobe-ITC Zapf Dingbats-Medium-R-Normal--

For X11/NeWS, one can use the OpenWindows scalable fonts instead, which
will give good quality output for any point size.  In this environment,
the relevant section of the resource file should look like this:

Ghostscript.regularFonts: \
	AvantGarde-Book:		-itc-avantgarde-book-r-normal-- \n\
	AvantGarde-BookOblique:		-itc-avantgarde-book-o-normal-- \n\
	AvantGarde-Demi:		-itc-avantgarde-demi-r-normal-- \n\
	AvantGarde-DemiOblique:		-itc-avantgarde-demi-o-normal-- \n\
	Bembo:				-monotype-bembo-medium-r-normal-- \n\
	Bembo-Bold:			-monotype-bembo-bold-r-normal-- \n\
	Bembo-BoldItalic:		-monotype-bembo-bold-i-normal-- \n\
	Bembo-Italic:			-monotype-bembo-medium-i-normal-- \n\
	Bookman-Demi:			-itc-bookman-demi-r-normal-- \n\
	Bookman-DemiItalic:		-itc-bookman-demi-i-normal-- \n\
	Bookman-Light:			-itc-bookman-light-r-normal-- \n\
	Bookman-LightItalic:		-itc-bookman-light-i-normal-- \n\
	Courier:			-itc-courier-medium-r-normal-- \n\
	Courier-Bold:			-itc-courier-bold-r-normal-- \n\
	Courier-BoldOblique:		-itc-courier-bold-o-normal-- \n\
	Courier-Oblique:		-itc-courier-medium-o-normal-- \n\
	GillSans:			-monotype-gill-medium-r-normal-sans- \n\
	GillSans-Bold:			-monotype-gill-bold-r-normal-sans- \n\
	GillSans-BoldItalic:		-monotype-gill-bold-i-normal-sans- \n\
	GillSans-Italic:		-monotype-gill-normal-i-normal-sans- \n\
	Helvetica:			-linotype-helvetica-medium-r-normal-- \n\
	Helvetica-Bold:			-linotype-helvetica-bold-r-normal-- \n\
	Helvetica-BoldOblique:		-linotype-helvetica-bold-o-normal-- \n\
	Helvetica-Narrow:		-linotype-helvetica-medium-r-narrow-- \n\
	Helvetica-Narrow-Bold:		-linotype-helvetica-bold-r-narrow-- \n\
	Helvetica-Narrow-BoldOblique:	-linotype-helvetica-bold-o-narrow-- \n\
	Helvetica-Narrow-Oblique:	-linotype-helvetica-medium-o-narrow-- \n\
	Helvetica-Oblique:		-linotype-helvetica-medium-o-normal-- \n\
	LucidaBright:			-b&h-lucidabright-medium-r-normal-- \n\
	LucidaBright-Demi:		-b&h-lucidabright-demibold-r-normal-- \n\
	LucidaBright-DemiItalic:	-b&h-lucidabright-demibold-i-normal-- \n\
	LucidaBright-Italic:		-b&h-lucidabright-medium-i-normal-- \n\
	LucidaSans:			-b&h-lucida-medium-r-normal-sans- \n\
	LucidaSans-Bold:		-b&h-lucida-bold-r-normal-sans- \n\
	LucidaSans-BoldItalic:		-b&h-lucida-bold-i-normal-sans- \n\
	LucidaSans-Italic:		-b&h-lucida-medium-i-normal-sans- \n\
	LucidaSans-Typewriter:		-b&h-lucidatypewriter-medium-r-normal-sans- \n\
	LucidaSans-TypewriterBold:	-b&h-lucidatypewriter-bold-r-normal-sans- \n\
	NewCenturySchlbk-BoldItalic:	-linotype-new century schoolbook-bold-i-normal-- \n\
	NewCenturySchlbk-Bold:		-linotype-new century schoolbook-bold-r-normal-- \n\
	NewCenturySchlbk-Italic:	-linotype-new century schoolbook-medium-i-normal-- \n\
	NewCenturySchlbk-Roman:		-linotype-new century schoolbook-medium-r-normal-- \n\
	Palatino-Bold:			-linotype-palatino-bold-r-normal-- \n\
	Palatino-BoldItalic:		-linotype-palatino-bold-i-normal-- \n\
	Palatino-Italic:		-linotype-palatino-medium-i-normal-- \n\
	Palatino-Roman:			-linotype-palatino-medium-r-normal-- \n\
	Rockwell:			-monotype-rockwell-medium-r-normal-- \n\
	Rockwell-Bold:			-monotype-rockwell-bold-r-normal-- \n\
	Rockwell-BoldItalic:		-monotype-rockwell-bold-i-normal-- \n\
	Rockwell-Italic:		-monotype-rockwell-medium-i-normal-- \n\
	Times-Bold:			-linotype-times-bold-r-normal-- \n\
	Times-BoldItalic:		-linotype-times-bold-i-normal-- \n\
	Times-Italic:			-linotype-times-medium-i-normal-- \n\
	Times-Roman:			-linotype-times-medium-r-normal-- \n\
	Utopia-Bold:			-adobe-utopia-bold-r-normal-- \n\
	Utopia-BoldItalic:		-adobe-utopia-bold-i-normal-- \n\
	Utopia-Italic:			-adobe-utopia-regular-i-normal-- \n\
	Utopia-Regular:			-adobe-utopia-regular-r-normal-- \n\
	ZapfChancery-MediumItalic:	-itc-zapfchancery-medium-i-normal-- \n
Ghostscript.dingbatFonts: \
	ZapfDingbats:			-itc-zapfdingbats-medium-r-normal--
Ghostscript.symbolFonts: \
	Symbol:				--symbol-medium-r-normal--

Users who switch regularly between different X servers may wish to use the
'*' wild card in place of the foundry name (itc, monotype, linotype, b&h,
or adobe); users who do not switch X servers should leave the explicit
foundry in the name, since it speeds up font accessing.

To set these resources, put them in a file (such as ~/.Xdefaults) in the
following form:

Ghostscript*geometry:	-0+0
Ghostscript*xResolution: 72
Ghostscript*yResolution: 72

Then load the defaults into the X server:

% xrdb -merge ~/.Xdefaults

Ghostscript will take advantage of the "HP XLFD Enhancements," if
available, to use native X11 fonts for fonts that are anamorphically
scaled, rotated, or mirrored.  If the user has installed these changes to
their X or font server, they will automatically be used when appropriate.

SCO Unix
--------

Because of bugs in the SCO Unix kernel, Ghostscript will not work if you
select direct screen output (gdevsco.c) and also allow it to write messages
on the console.  If you are using direct screen output, redirect
Ghostscript's terminal output to a file.

********
******** Switches
********

Unless otherwise noted, these apply to all platforms.

Normal switches
---------------

	@filename
		Causes Ghostscript to read filename and treat its
		contents the same as the command line.  (This is
		intended primarily for getting around MS-DOS's
		128-character limit on the length of a command line.)
		Switches or file names in the file may be separated by
		any amount of white space (space, tab, line break);
		there is no limit on the size of the file.

	-- filename arg1 ...
	-+ filename arg1 ...
		Takes the next argument as a file name as usual, but takes
		all remaining arguments (even if they have the syntactic
		form of switches) and defines the name ARGUMENTS in
		userdict (not systemdict) as an array of those strings,
		*before* running the file.  When Ghostscript finishes
		executing the file, it exits back to the shell.

	-@ filename arg1 ...
		Does the same thing as -- and -+, but expands @filename
		arguments.

	-c tokens ...
		Interprets arguments, up to the next argument that begins
		with - followed by a non-digit or with @, as PostScript
		code.  For example, if the file quit.ps contains just
		the word `quit', the following are equivalent:
			quit.ps
		and
			-c quit
		Each argument must be exactly one token, as defined by
		the `token' operator.

	-Dname=token
	-dname=token
		Define a name in systemdict with the given definition.
		The token must be exactly one token (as defined by the
		'token' operator) and must not contain any whitespace.

	-Dname
	-dname
		Define a name in systemdict with value=true.

	-Sname=string
	-sname=string
		Define a name in systemdict with a given string as value.
		This is different from -d.  For example,
			-dname=35
		is equivalent to the program fragment
			/name 35 def
		whereas
			-sname=35
		is equivalent to
			/name (35) def

	-q
		Quiet startup -- suppress normal startup messages,
		and also do the equivalent of -dQUIET.

	-ffilename
		Execute the given file, even if its name begins with a -
		or an @.  -f alone does nothing, but it provides a
		convenient way to terminate the list of tokens for the -c
		switch.

	-gnumber1xnumber2
		Equivalent to -dDEVICEWIDTH=number1 and
		-dDEVICEHEIGHT=number2.  This is for the benefit of
		devices (such as X11 windows and VESA displays) that require
		(or allow) width and height to be specified.

	-rnumber
	-rnumber1xnumber2
		Equivalent to -dDEVICEXRESOLUTION=number1 and
		-dDEVICEYRESOLUTION=number2.  This is for the benefit of
		devices (such as printers) that support multiple
		X and Y resolutions.

	-Idirectories
		Adds the designated list of directories at the head of the
		search path for library files.

	-
		This is not really a switch.  It indicates to Ghostscript
		that the standard input is coming from a file or a pipe.
		Ghostscript reads from stdin until reaching end-of-file,
		executing it like any other file, and then continues
		processing the command line.  At the end of the command
		line, Ghostscript exits rather than going into its
		interactive mode.

Note that gs_init.ps makes systemdict read-only, so the values of names
defined with -D/d/S/s cannot be changed (although, of course, they can be
superseded by definitions in userdict or other dictionaries.)

Special names
-------------

-dDISKFONTS
	causes individual character outlines to be loaded from the disk
the first time they are encountered.  (Normally Ghostscript loads all the
character outlines when it loads a font.)  This may allow loading more
fonts into RAM, at the expense of slower rendering.

-dNOBIND
	disables the 'bind' operator.  Only useful for debugging.

-dNOCACHE
	disables character caching.  Only useful for debugging.

-dNOCIE
	substitutes DeviceGray and DeviceRGB for CIEBasedA and CIEBasedABC
color spaces respectively.  Only useful on very slow systems where color
accuracy is less important.

-dNODISPLAY
	suppresses the normal initialization of the output device.  This
may be useful when debugging.

-dNOGC
	disables the garbage collector in Level 2 systems.  Only
useful for debugging.

-dNOPAUSE
	disables the prompt and pause at the end of each page.  This may
be desirable for applications where another program is 'driving'
Ghostscript.

-dNOPLATFONTS
	disables the use of fonts supplied by the underlying platform
(X Windows or Microsoft Windows).  This may be needed if the platform
fonts look undesirably different from the scalable fonts.

-dORIENT1
	indicates that the file uses a value of 1 to indicate portrait
orientation to setpage[params] rather than the default orientation of 0.
This is needed for some files produced by badly designed applications that
'know' that the output will be printed on certain roll-media printers.

-dSAFER
	disables the deletefile and renamefile operators, and the
ability to open files in any mode other than read-only.  This may be
desirable for spoolers or other sensitive environments.

-dWRITESYSTEMDICT
	leaves systemdict writable.  This is necessary when running
special utility programs such as font2c and pcharstr, which must bypass
normal PostScript access protection.

-sDEVICE=device
	selects an alternate initial output device, as described above.

-sOutputFile=filename
	selects an alternate output file (or pipe) for the initial output
device, as described above.

Debugging switches
------------------

The -Z switch only applies if the interpreter was built for a
debugging configuration (DEBUG=1 or -DDEBUG selected at compile
time).

	-A	Fill empty storage with a distinctive bit pattern
		for debugging.  Equivalent to -Z@.

	-E	Turn on tracing of error returns from operators.
		Equivalent to -Z#.

	-Mn	Force the interpreter's allocator to acquire additional
		memory in units of nK, rather than the default (currently
		20K on MS-DOS systems, 50K on Unix).  n is a positive
		decimal integer (not exceeding 63 on MS-DOS systems).

	-Zxxx	Turn on debugging printout.
		Each of the xxx characters selects an option.
		Case is significant.
			0 = OS-related calls
			1 = type 1 font interpreter (type1addpath)
			2 = curve subdivider/rasterizer
			  3 = curve subdivider/rasterizer, detail
			4 = garbage collector (strings)
			  5 = garbage collector (strings, detail)
			6 = garbage collector (chunks, roots)
			  7 = garbage collector (objects)
			  8 = garbage collector (refs)
			  9 = garbage collector (pointers)
			a = allocator (large blocks only)
			  A = allocator (all calls)
			b = bitmap image processor
			  B = bitmap images, detail
			c = color/halftone mapper
			d = dictionary put/undef
			  D = dictionary lookups
			f = fill algorithm (summary)
			  F = fill algorithm (detail)
			g = gsave/grestore[all]
			h = halftone renderer
			  H = halftones, every pixel
			i = interpreter, just names
			  I = interpreter, everything
			j = (Japanese) composite fonts
			k = character cache & xfonts
			  K = character cache, every access
			l = command lists, bands
			  L = command lists, everything
			m = makefont and font cache
			n = name lookup (new names only)
			o = outliner (stroke)
			  O = stroke detail
			p = path tracer
			q = clipping
			r = arc renderer
			s = streams
			  S = scanner
			t = tiling algorithm
			u = undo saver (for save/restore), finalization
			  U = undo saver, more detail
			v = rectangle fill
			  V = device-level output
			w = compression encoder/decoder
			x = transformations
			y = Type 1 hints
			  Y = Type 1 hints, every access
			z = trapezoid fill
			# = operator error returns
			~ = math functions
		The following switches select debugging options other than
		printout.
			$ = set unused parts of object references to
				identifiable garbage values
			+ = use minimum-size stack blocks
			. = use small-memory table sizes even on
				large-memory machines
			? = validate pointers before, during and after GC,
				also before and after save and restore
			@ = clear storage when allocating or freeing

********
******** Frequently Asked Questions
********

Q: The spacing of characters / words / margins on the display is
wrong, what can I do?

A: This is almost always caused by differences between the character
widths that were used to format the document and the character widths
of the fonts installed in your system.  (This only affects the
display, and only with window systems, not with MS-DOS.)  If this
happens, invoke Ghostscript with the -dNOPLATFONTS switch, or (on X
Windows) set
	Ghostscript*useExternalFonts: false
in your X resource file.

For more information about fonts on the display, please read the
first sections of fonts.doc.

Q: On my H-P LaserJet, why do I only get a partial page of output, or a
single page gets split across two sheets?

A: Printing on a Hewlett-Packard LaserJet at full resolution (300 DPI)
requires a printer with at least 1.5 Mb of memory.  150 DPI printing
requires only .5 Mb.  You can select 150 DPI printing with the command
line switch
	-r150
(This is not necessary on DeskJet printers.)

Q: On my MS-DOS system using GS.EXE (Borland compiler), why do I get a
`limitcheck in setdevice' or `VMerror in setdevice' error message?

A: On MS-DOS systems using the Borland compiler, if Ghostscript gives you
a 'limitcheck in setdevice' error, it may mean Ghostscript's standard
buffer size wasn't large enough.  Likewise, if Ghostscript gives you a
'VMerror in setdevice' error, it means the buffer size was too large.  You
can use the -dBufferSpace= switch to set the buffer size to a different
value, e.g.,
	-dBufferSpace=50000
The default value is 25000; the smallest value Ghostscript accepts is
10000; the largest valid value is 65000.