Debian Codegraph @

contrib/pcl3/doc/gs-mods.txt

raw
1 *******************************************************************************
2 File: @(#)$Id: gs-mods.txt,v 2.3 2001/08/19 09:04:56 Martin Rel $
3 Contents: Suggested changes to ghostscript's source code or configuration
4 Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig,
5 Germany. E-mail: [email protected].
6
7 *******************************************************************************
8 * *
9 * Copyright (C) 1997, 1998, 1999, 2000, 2001 by Martin Lottermoser *
10 * All rights reserved *
11 * *
12 *******************************************************************************
13
14 Changes to source code require recompilation of ghostscript, changes to the
15 configuration files can be made at any time, even after installation.
16
17
18 Changes to Source Code
19 **********************
20
21 S1 Present ghostscript versions have a bug in make_adjustment_matrix() when
22 given significantly positive lower bounds for size ranges in
23 "InputAttributes". I have provided an appropriate patch in
24 src/zmedia2.c-N.NN.diff. To test for this bug if you already have a working
25 binary of ghostscript including the "bit" device, run
26
27 gs -sDEVICE=bit
28
29 on the following PostScript code:
30
31 << /InputAttributes
32 << 0 << /PageSize [ 100 100 700 900 ] >> >>
33 >> setpagedevice
34 << /PageSize [ 200 300 ] >> setpagedevice
35 matrix defaultmatrix ==
36 quit
37
38 This tells ghostscript to assume that the device supports media widths
39 between 100 and 700 and heights between 100 and 900 bp, and requests a
40 page size 200 bp wide and 300 bp tall. Ghostscript should print
41
42 [1.0 0.0 0.0 -1.0 0.0 300.0]
43
44 on standard output if you don't have the bug and
45
46 [1.0 0.0 0.0 -1.0 200.0 0.0]
47
48 if you do. You can use other drivers to test for this, too, but to reliably
49 evaluate the result you need information on the driver's device coordinate
50 system.
51
52 A simple visual test can be made by replacing the last two lines in the
53 program, "matrix ... quit", by
54
55 /Courier findfont 10 scalefont setfont
56 100 150 moveto (Hello) show
57 showpage
58
59 and running it through a real device driver, preferably for the screen.
60 If you have the bug, the page will be empty, if you don't, you'll see
61 "Hello" in the middle.
62
63 If you are unsure whether to apply the patch, proceed without it and do
64 the test afterwards. The worst which can happen is that you'll have to
65 recompile after patching.
66
67 I had reported this bug to L. Peter Deutsch on 1997-12-02. He promised to
68 look at it when he would have time. The bug is still present in gs 7.0,
69 released more than three years later.
70
71 S2 There is a bug in the UNIX make files for GNU ghostscript 6.51 which leads
72 to a failure during "make install" when trying to install the manual pages.
73 Add the line
74
75 man1dir = $(mandir)/man$(man1ext)
76
77 to your platform-specific makefile to fix this problem.
78
79
80
81 Changes to Configuration Files
82 ******************************
83
84 C1 There is a bug in ghostscript's default configuration for the
85 undercolour removal and black generation functions. It shows up when
86 printing PostScript documents using the RGB colour space ("setrgbcolor" or
87 "sethsbcolor") on a device where the CMYK space is the native colour space;
88 this is the case for pcl3 if you specify "-sColourModel=CMYK". The bug
89 results in black being printed as a mixture of cyan, magenta, and yellow.
90 On my printer, this is a slightly greenish grey with fuzzy edges.
91
92 To check for the presence of this bug, run gs on the following command:
93
94 0 0 0 setrgbcolor [ currentcmykcolor ] ==
95
96 gs will issue "[1.0 1.0 1.0 0.0]" on standard output if it would print the
97 mixture and "[0.0 0.0 0.0 1.0]" if it would print true black. You should
98 specify a CMYK device like "bitcmyk" for this test.
99
100 To correct this behaviour, you'll have to modify gs_init.ps. Look for the
101 following lines (starting at line 1263 in AFPL gs 7.0 and at line 1247 in
102 GNU ghostscript 6.51):
103
104 % Set the default screen and BG/UCR.
105 /.setdefaultbgucr {
106 systemdict /setblackgeneration known {
107 { pop 0 } dup setblackgeneration setundercolorremoval
108 } if
109 } bind def
110
111 Replace the line containing "setundercolorremoval" with the following:
112
113 {} dup setblackgeneration setundercolorremoval
114
115 I had reported this bug to L. Peter Deutsch on 1998-12-09 and he wrote he
116 would change the behaviour in the next release. This happened subsequently
117 in gs 6.0 (released 2000-02-03), but gs 6.01 reverted to the previous
118 behaviour.
119
120 C2 Ghostscript's default configuration prohibits a driver from seeing the
121 value of the standard page device parameter "LeadingEdge" if set from
122 PostScript; it is only visible if you set it from the command line. This is
123 a logical error in ghostscript because (a) "LeadingEdge" fixes the
124 orientation between default user space and the feeding direction which is a
125 property of the default CTM, and because (b) determining the default CTM in
126 ghostscript is the job of the driver-specific get_initial_matrix device
127 procedure. Hence the driver must have access to the value of "LeadingEdge".
128
129 To change this, edit the definition of ".presentspecial" in gs_setpd.ps to
130 not include "LeadingEdge". Look for the line "/.presentspecial mark" and
131 after that for the following lines (starting at line 356 in
132 GNU ghostscript 6.51 and at line 355 in AFPL ghostscript 7.0):
133
134 /InputAttributes false
135 .inputattrkeys
136 { dup /PageSize eq
137 { pop }
138 { { 2 index /InputAttributes .knownget { null eq } { true } ifelse } }
139 ifelse
140 }
141 forall
142
143 Replace the line containing "PageSize" with the following:
144
145 { dup dup /PageSize eq exch /LeadingEdge eq or
146
147 You need correct this bug only if you wish to set "LeadingEdge" from
148 PostScript. This is normally not necessary except when you are using a
149 document manager with pcl3's PPD files to print on a custom page size in a
150 non-default orientation.
151
152 C3 Unless your default media size is US Letter, it is a good idea to remove
153 the "%" comment in the "% (a4)..." line in gs_init.ps in order to set the
154 default page size to ISO A4 instead of US Letter (see also Use.htm in the
155 ghostscript distribution). This is essential for correctly printing all
156 documents not explicitly requesting a page size.
157
158 C4 If you intend to use PostScript resources, you should also edit the
159 definitions of "FontResourceDir" and "GenericResourceDir" in gs_res.ps to
160 reflect your local conventions. (And if you don't know what I'm talking
161 about you don't need it.)