author | tm |
Tue, 24 Sep 2002 15:56:00 +0200 | |
changeset 1091 | 153d101d7015 |
parent 1075 | 7272338c6b53 |
child 1108 | e5be3dd73130 |
permissions | -rw-r--r-- |
0 | 1 |
" |
4 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
71 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
913
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
13 |
"{ Package: 'stx:libbasic2' }" |
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
14 |
|
0 | 15 |
PrinterStream subclass:#PostscriptPrinterStream |
1075 | 16 |
instanceVariableNames:'xPos yPos lineStream colNr lineNr fFamily fStyle pageStartAction |
17 |
pageEndAction pageCount sendXPosition' |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
18 |
classVariableNames:'Prolog Trailer PageProlog PageTrailer FontNames FontHeight |
378 | 19 |
FontWidth LeftX TopY PageHeight LinesPerPage PhysicalPageHeight |
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
20 |
Italic Bold Normal BoldItalic Courier Times Helvetica TopMargin |
437 | 21 |
LeftMargin BottomMargin RightMargin SupportsColor Resolution' |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
22 |
poolDictionaries:'' |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
23 |
category:'Streams-External' |
0 | 24 |
! |
25 |
||
467 | 26 |
!PostscriptPrinterStream class methodsFor:'documentation'! |
6 | 27 |
|
31 | 28 |
copyright |
29 |
" |
|
30 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
71 | 31 |
All Rights Reserved |
31 | 32 |
|
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
! |
|
41 |
||
6 | 42 |
documentation |
43 |
" |
|
28 | 44 |
This class provides simple text output to postscript printers; |
31 | 45 |
to use it, evaluate |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
46 |
Smalltalk at:#Printer put:PostscriptPrinterStream |
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
170
diff
changeset
|
47 |
(usually in some rc file). |
361 | 48 |
or change it via the launchers settings-menu. |
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
170
diff
changeset
|
49 |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
50 |
See examples on how to send something to the printer. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
51 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
52 |
For now, only Helvetica, Courier and Times fonts in italic, roman and bold |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
53 |
are supported. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
54 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
55 |
It does not directly support graphics and other fancy features of Postscript, |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
56 |
but provides a compatible interface for simple text line-printing |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
57 |
(see other subclasses of PrinterStream). |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
58 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
59 |
If you already have a postscript string at hand, this can be sent to |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
60 |
the printer in native mode. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
61 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
62 |
To output graphics, you need the PSGraphicsContext (and friend-) classes. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
63 |
These provide protocol similar to the one provided by display graphicContexts. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
64 |
Notice, that these postscript classes are derived from public domain code; |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
65 |
there is no warranty. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
66 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
67 |
[see also:] |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
68 |
PSGraphicsContext |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
69 |
EpsonFX1PrinterStream HPLjetIIPrinterStream PrinterStream |
259 | 70 |
|
71 |
[author:] |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
72 |
Claus Gittinger |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
73 |
" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
74 |
! |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
75 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
76 |
examples |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
77 |
" |
223 | 78 |
For text printing, use: |
391 | 79 |
[exBegin] |
80 |
|s| |
|
223 | 81 |
|
391 | 82 |
s := Printer new. |
83 |
s nextPutAll:'hello'; cr. |
|
84 |
s nextPutAll:'normal '. |
|
85 |
s bold; nextPutAll:'this is bold'; normal; cr. |
|
86 |
s nextPutAll:'normal '. |
|
87 |
s italic; nextPutAll:'this is italic'; normal; cr. |
|
88 |
s nextPutAll:'normal '. |
|
89 |
s boldItalic; nextPutAll:'this is boldItalic'; normal; cr. |
|
90 |
s nextPutAll:'normal '. |
|
91 |
s underline; nextPutAll:'this is underlined'; noUnderline; cr. |
|
92 |
s nextPutAll:'normal again '. |
|
93 |
s strikeout; nextPutAll:'this is strikedout'; noStrikeout; cr. |
|
94 |
s helvetica. |
|
95 |
s nextPutAll:'helvetica '. |
|
96 |
s underline; nextPutAll:' helv-underline'; noUnderline; |
|
97 |
space; strikeout; nextPutAll:'helv-strikeout'; noStrikeout; |
|
98 |
bold; nextPutAll:' helv-bold'; normal; cr. |
|
99 |
s times. |
|
100 |
s nextPutAll:'times'; cr. |
|
101 |
s courier. |
|
102 |
s nextPutAll:'courier'; cr. |
|
103 |
s close |
|
104 |
[exEnd] |
|
349 | 105 |
or, if you already have emphasized text at hand: |
391 | 106 |
[exBegin] |
107 |
|s| |
|
349 | 108 |
|
391 | 109 |
s := Printer new. |
110 |
s nextPutAll:'hello'; cr. |
|
111 |
s nextPutAll:'this is '; |
|
112 |
nextPutAll:(Text string:'bold' emphasis:#bold); |
|
113 |
cr; |
|
114 |
nextPutAll:'this is '; |
|
115 |
nextPutAll:(Text string:'italic' emphasis:#italic); |
|
116 |
cr; |
|
117 |
nextPutAll:'this is '; |
|
118 |
nextPutAll:(Text string:'boldItalic' emphasis:#(bold italic)); |
|
119 |
cr; |
|
120 |
nextPutAll:'normal again'; |
|
121 |
cr; |
|
122 |
helvetica; |
|
123 |
nextPutAll:'helvetica'; |
|
124 |
cr; |
|
125 |
times; |
|
126 |
nextPutAll:'times'; |
|
127 |
cr; |
|
128 |
courier; |
|
129 |
nextPutAll:'courier'; |
|
130 |
cr. |
|
131 |
s close |
|
132 |
[exEnd] |
|
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
170
diff
changeset
|
133 |
|
361 | 134 |
placing a page-hook, to add a page number: |
135 |
(page hooks require that you understand some postscript ... |
|
136 |
... and have a look at how this class generates its postscript code) |
|
391 | 137 |
[exBegin] |
138 |
|s hook pageNr| |
|
361 | 139 |
|
391 | 140 |
s := Printer new. |
361 | 141 |
|
391 | 142 |
pageNr := 0. |
143 |
hook := [ |
|
361 | 144 |
|
391 | 145 |
pageNr := pageNr + 1. |
146 |
s placeString:('page ' , pageNr printString) at:(5500 @ 400). |
|
147 |
]. |
|
361 | 148 |
|
391 | 149 |
s pageEndAction:hook. |
150 |
(1 to:200) do:[:lineNr | |
|
151 |
s nextPutAll:'line ' , lineNr printString. |
|
152 |
s cr. |
|
153 |
]. |
|
154 |
s close. |
|
155 |
[exEnd] |
|
361 | 156 |
|
157 |
||
158 |
placing a page-hook, to add a custom frame, logo or company letter-head: |
|
159 |
(page hooks require that you understand some postscript ... |
|
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
160 |
... and have a look at how this class generates its postscript code. |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
161 |
... and notice that the code below is a q&d demo, working with letter-sized |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
162 |
pages only; a real program should ask the printerStream about the actual |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
163 |
pageHeight/pageWidth.) |
391 | 164 |
[exBegin] |
165 |
|s hook pageNr| |
|
361 | 166 |
|
391 | 167 |
s := Printer new. |
361 | 168 |
|
391 | 169 |
pageNr := 0. |
170 |
hook := [ |
|
361 | 171 |
|
391 | 172 |
pageNr := pageNr + 1. |
173 |
s placeString:('page ' , pageNr printString) at:(5500 @ 400). |
|
174 |
s placeString:('Document revision:') at:(900 @ 1200). |
|
175 |
s placeString:('Revieved by:') at:(900 @ 900). |
|
361 | 176 |
|
391 | 177 |
s setNative:true. |
178 |
s nextPutAll:'0 setlinewidth'; cr. |
|
179 |
s nextPutAll:'800 800 moveto'; cr. |
|
180 |
s nextPutAll:'11000 800 lineto'; cr. |
|
181 |
s nextPutAll:'11000 15500 lineto'; cr. |
|
182 |
s nextPutAll:'800 15500 lineto'; cr. |
|
183 |
s nextPutAll:'800 800 lineto'; cr. |
|
184 |
s nextPutAll:'stroke'; cr. |
|
361 | 185 |
|
391 | 186 |
s nextPutAll:'800 1100 moveto'; cr. |
187 |
s nextPutAll:'11000 1100 lineto'; cr. |
|
188 |
s nextPutAll:'stroke'; cr. |
|
361 | 189 |
|
391 | 190 |
s nextPutAll:'800 1400 moveto'; cr. |
191 |
s nextPutAll:'11000 1400 lineto'; cr. |
|
192 |
s nextPutAll:'stroke'; cr. |
|
361 | 193 |
|
391 | 194 |
s setNative:false. |
195 |
]. |
|
361 | 196 |
|
391 | 197 |
s pageEndAction:hook. |
198 |
(1 to:200) do:[:lineNr | |
|
199 |
s nextPutAll:'line ' , lineNr printString. |
|
200 |
s cr. |
|
201 |
]. |
|
202 |
s close. |
|
203 |
[exEnd] |
|
361 | 204 |
|
205 |
||
223 | 206 |
If you already have a postscript string at hand, this can be sent to |
207 |
the printer in native mode: |
|
391 | 208 |
[exBegin] |
209 |
|s| |
|
223 | 210 |
|
391 | 211 |
s := Printer newNative. |
212 |
s nextPutAll:<your postscript string>. |
|
213 |
[exEnd] |
|
214 |
s close |
|
223 | 215 |
|
179
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
170
diff
changeset
|
216 |
To output graphics, you need the PSGraphicsContext (and friend-) classes. |
38773360f4b7
more on printing (printerType-query)
Claus Gittinger <cg@exept.de>
parents:
170
diff
changeset
|
217 |
These provide protocol similar to the one provided by display graphicContexts. |
223 | 218 |
Notice, that these postscript classes are derived from public domain code; |
219 |
there is no warranty. |
|
220 |
||
221 |
Usage: |
|
391 | 222 |
[exBegin] |
223 |
|drawable s| |
|
223 | 224 |
|
391 | 225 |
s := Printer newNative. |
226 |
drawable := PSGraphicsContext on:s. |
|
223 | 227 |
|
391 | 228 |
drawable displayLineFrom:(0@0) to:(100@100). |
229 |
drawable displayLineFrom:(100@0) to:(0@100). |
|
230 |
drawable displayCircle:(150@150) radius:50. |
|
231 |
(Image fromFile:'bitmaps/SBrowser.xbm') displayOn:drawable at:(50@30). |
|
223 | 232 |
|
391 | 233 |
drawable close. |
234 |
[exEnd] |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
235 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
236 |
the same in a view: |
391 | 237 |
[exBegin] |
238 |
|drawable| |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
239 |
|
391 | 240 |
drawable := (View extent:200@200) openAndWait. |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
241 |
|
391 | 242 |
drawable displayLineFrom:(0@0) to:(100@100). |
243 |
drawable displayLineFrom:(100@0) to:(0@100). |
|
244 |
drawable displayCircle:(150@150) radius:50. |
|
245 |
(Image fromFile:'bitmaps/SBrowser.xbm') displayOn:drawable at:(50@30). |
|
246 |
[exEnd] |
|
6 | 247 |
" |
248 |
! ! |
|
0 | 249 |
|
467 | 250 |
!PostscriptPrinterStream class methodsFor:'initialization'! |
0 | 251 |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
252 |
initCharacterSize |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
253 |
"setup the character parameters" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
254 |
|
361 | 255 |
FontHeight := 200. "/ used to scale fonts - corresponds to a 10 point font size |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
256 |
FontWidth := 120. "/ used to compute width of tabs |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
257 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
258 |
"Created: 23.4.1996 / 19:53:34 / cg" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
259 |
"Modified: 23.4.1996 / 20:05:17 / cg" |
361 | 260 |
"Modified: 30.5.1996 / 17:24:05 / ca" |
0 | 261 |
! |
262 |
||
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
263 |
initFonts |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
264 |
"setup the font names. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
265 |
initProlog uses those parameters." |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
266 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
267 |
Italic := 0. "/ offset from base-font# to italic version |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
268 |
Bold := 1. "/ offset from base-font# to bold version |
349 | 269 |
BoldItalic := 2. "/ offset from base-font# to boldItalic version |
270 |
Normal := 3. "/ offset from base-font# to normal version |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
271 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
272 |
Helvetica := 0. "/ # of helvetica base font |
349 | 273 |
Times := 4. "/ # of times base font |
274 |
Courier := 8. "/ # of courier base font |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
275 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
276 |
FontNames := #( |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
277 |
'Helvetica-Oblique' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
278 |
'Helvetica-Bold' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
279 |
'Helvetica-BoldOblique' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
280 |
'Helvetica' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
281 |
'Times-Italic' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
282 |
'Times-Bold' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
283 |
'Times-BoldItalic' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
284 |
'Times' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
285 |
'Courier-Oblique' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
286 |
'Courier-Bold' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
287 |
'Courier-BoldOblique' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
288 |
'Courier' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
289 |
) |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
290 |
|
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
291 |
" |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
292 |
PostscriptPrinterStream initFonts |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
293 |
" |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
294 |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
295 |
! |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
296 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
297 |
initPage |
361 | 298 |
"setup the page parameters. |
370 | 299 |
All coordinates are scaled by 20 w.r.t the PS coordinates (i.e. in twips)." |
300 |
||
301 |
PageFormat isNil ifTrue:[ |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
302 |
PageFormat := #letter |
370 | 303 |
]. |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
304 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
305 |
TopMargin isNil ifTrue:[ |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
306 |
TopMargin := 0.6. "/ inches |
370 | 307 |
]. |
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
308 |
BottomMargin isNil ifTrue:[ |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
309 |
BottomMargin := 1.2 "/ inches |
370 | 310 |
]. |
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
311 |
LeftMargin isNil ifTrue:[ |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
312 |
LeftMargin := 0.6. "/ inches |
370 | 313 |
]. |
437 | 314 |
RightMargin isNil ifTrue:[ |
315 |
RightMargin := 0.6. "/ inches |
|
316 |
]. |
|
317 |
Resolution isNil ifTrue:[ |
|
318 |
Resolution := 300@300. "/ DPI |
|
319 |
]. |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
320 |
|
361 | 321 |
"/ +-----------------------------------------------+ PageHeight |
437 | 322 |
"/ | TOPMARGIN | | |
361 | 323 |
"/ | LeftX +---------------------------------------| TopY |
437 | 324 |
"/ | |1st printed line | | |
325 |
"/ | | | | |
|
326 |
"/ | LEFT | |RIGHT| (only used by |
|
327 |
"/ | MARGIN| |MARG.| PSGraphicsContext) |
|
328 |
"/ | | | | |
|
329 |
"/ | |last line (linesPerPage) | | |
|
361 | 330 |
"/ | +---------------------------------------| |
437 | 331 |
"/ | BOTTOMMARGIN | | |
361 | 332 |
"/ (0/0)-------------------------------------------+ 0 |
333 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
334 |
LeftX := (UnitConverter convert:LeftMargin from:#inch to:#twip) rounded. |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
335 |
|
370 | 336 |
PhysicalPageHeight := (UnitConverter convert:1 from:(PageFormat , 'H') to:#twip) rounded. |
447 | 337 |
Landscape == true ifTrue:[ |
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
338 |
PageHeight := (UnitConverter convert:1 from:(PageFormat , 'lH') to:#twip) rounded. |
370 | 339 |
] ifFalse:[ |
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
340 |
PageHeight := (UnitConverter convert:1 from:(PageFormat , 'H') to:#twip) rounded. |
370 | 341 |
]. |
342 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
343 |
TopY := PageHeight - (UnitConverter convert:TopMargin from:#inch to:#twip) rounded. |
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
344 |
LinesPerPage := TopY - (UnitConverter convert:BottomMargin from:#inch to:#twip) rounded // 200. |
370 | 345 |
|
386 | 346 |
" |
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
347 |
TopMargin := LeftMargin := BottomMargin := nil. |
386 | 348 |
self initPage |
349 |
" |
|
350 |
||
361 | 351 |
"Modified: 30.5.1996 / 17:24:55 / ca" |
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
352 |
"Modified: 5.9.1996 / 21:43:00 / cg" |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
353 |
! |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
354 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
355 |
initPageProlog |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
356 |
"define the page prolog" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
357 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
358 |
PageProlog := |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
359 |
'StartPage |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
360 |
'. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
361 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
362 |
"Created: 23.4.1996 / 19:56:16 / cg" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
363 |
! |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
364 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
365 |
initPageTrailer |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
366 |
"define the page epilog" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
367 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
368 |
PageTrailer := |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
369 |
'EndPage |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
370 |
'. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
371 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
372 |
"Modified: 23.4.1996 / 19:55:50 / cg" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
373 |
"Created: 23.4.1996 / 19:56:30 / cg" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
374 |
! |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
375 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
376 |
initProlog |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
377 |
"define the documents prolog" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
378 |
|
0 | 379 |
|tmpString t fontNr| |
380 |
||
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
381 |
tmpString := |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
382 |
'%!!PS-Adobe-2.0 |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
383 |
%%Creator: Smalltalk/X |
438
c38453be27ae
put cleanup stuff after %%Trailer
Claus Gittinger <cg@exept.de>
parents:
437
diff
changeset
|
384 |
%%CreationDate: ' , AbsoluteTime now printString , ' |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
385 |
%%DocumentFonts: '. |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
386 |
|
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
387 |
FontNames do:[:aName | |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
388 |
tmpString := tmpString , aName , ' ' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
389 |
]. |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
390 |
|
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
391 |
tmpString := tmpString , ' |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
392 |
%%Pages: (atend) |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
393 |
%%EndComments |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
394 |
|
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
395 |
save /SmalltalkJob exch def |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
396 |
|
361 | 397 |
/OriginalState gstate def |
0 | 398 |
/StartSmalltalkDoc{$smalltalk begin}def |
399 |
/$smalltalk 50 dict def $smalltalk begin |
|
400 |
/EndSmalltalkDoc{end}def |
|
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
401 |
|
0 | 402 |
/S/show load def |
403 |
/X{exch 0 rmoveto S}def |
|
404 |
/Y{exch 0 exch rmoveto S}def |
|
405 |
/B{3 1 roll moveto S}def |
|
382 | 406 |
/SUL {gsave currentpoint currentfont /FontInfo get /UnderlinePosition get |
407 |
0 exch currentfont /FontMatrix get dtransform exch pop add newpath moveto |
|
408 |
dup stringwidth rlineto stroke grestore S} def |
|
391 | 409 |
/SSO {gsave currentpoint 300 |
410 |
0 exch currentfont /FontMatrix get dtransform exch pop add |
|
411 |
newpath moveto dup stringwidth rlineto stroke grestore S} def |
|
382 | 412 |
/BUL{3 1 roll moveto SUL}def |
391 | 413 |
/BSO{3 1 roll moveto SSO}def |
0 | 414 |
/F{$fd exch get setfont}def |
415 |
/StartPage{/svpg save def .05 dup scale}def |
|
416 |
/EndPage{svpg restore showpage}def |
|
417 |
/DoPreFeed{/statusdict where{pop |
|
418 |
statusdict/prefeed known{statusdict exch/prefeed exch put 0}if}if pop}def |
|
373 | 419 |
/Landscape{90 rotate 0 -' , PageHeight printString "15840", ' translate}def |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
420 |
/ISOrecode {findfont dup length dict begin |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
421 |
{1 index /FID ne {def} {pop pop} ifelse} forall |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
422 |
/Encoding ISOLatin1Encoding def |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
423 |
currentdict end definefont pop} def |
0 | 424 |
/SetUpFonts |
425 |
{dup/$fd exch array def{findfont exch scalefont $fd 3 1 roll put}repeat}def |
|
426 |
/InitGaudy{/TwoColumn exch def /BarLength exch def |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
427 |
/ftD /ISO-Times-Bold findfont 12 UP scalefont def |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
428 |
/ftF /ISO-Times-Roman findfont 14 UP scalefont def |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
429 |
/ftP /ISO-Helvetica-Bold findfont 30 UP scalefont def}def |
0 | 430 |
/U{1440 mul}def |
431 |
/UP{U 72 div}def |
|
432 |
/LB{/pts exch UP def /charcolor exch def /boxcolor exch def /font exch def |
|
433 |
/label exch def /dy exch def /dx exch def /lly exch def /llx exch def |
|
434 |
gsave boxcolor setgray |
|
435 |
llx lly moveto dx 0 rlineto 0 dy rlineto dx neg 0 rlineto closepath fill |
|
436 |
/lines label length def |
|
437 |
/yp lly dy add dy lines pts mul sub 2 div sub pts .85 mul sub def |
|
438 |
font setfont charcolor setgray |
|
439 |
label {dup stringwidth pop 2 div llx dx 2 div add exch sub yp moveto show |
|
440 |
/yp yp pts sub def}forall grestore}def |
|
441 |
/Gaudy{/Page exch def /Date exch def /File exch def /Comment exch def |
|
442 |
.25 U 10.2 U BarLength .1 sub U .25 U [File] ftF .97 0 14 LB |
|
443 |
.25 U 10.45 U BarLength .1 sub U .25 U [Comment] ftF 1 0 14 LB |
|
444 |
.25 U 10.2 U 1 U .5 U Date ftD .7 0 12 LB |
|
445 |
BarLength .75 sub U 10.2 U 1 U .5 U [Page] ftP .7 1 30 LB |
|
446 |
TwoColumn{BarLength 2 div .19 add U 10.2 U moveto 0 -10 U rlineto stroke}if |
|
447 |
}def |
|
448 |
end |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
449 |
StartSmalltalkDoc |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
450 |
% end of fixed prolog |
0 | 451 |
'. |
452 |
||
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
453 |
t := ''. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
454 |
FontNames do:[:aName | |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
455 |
t := t , '/ISO-' , aName , ' /' , aName , ' ISOrecode |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
456 |
'. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
457 |
]. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
458 |
t := t , ' |
0 | 459 |
'. |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
460 |
tmpString := tmpString , t. |
0 | 461 |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
462 |
t := ''. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
463 |
fontNr := 0. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
464 |
FontNames do:[:aName | |
391 | 465 |
t := t , (fontNr printString) , ' ' |
466 |
, (FontHeight printString) , ' ' |
|
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
467 |
, '/ISO-' , aName , (Character nl) asString. |
391 | 468 |
fontNr := fontNr + 1 |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
469 |
]. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
470 |
tmpString := tmpString , t. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
471 |
tmpString := tmpString , fontNr printString , ' SetUpFonts |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
472 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
473 |
% end of prolog |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
474 |
%%EndProlog |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
475 |
'. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
476 |
Prolog := tmpString. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
477 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
478 |
" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
479 |
PostscriptPrinterStream initProlog |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
480 |
" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
481 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
482 |
"Created: 23.4.1996 / 19:40:44 / cg" |
438
c38453be27ae
put cleanup stuff after %%Trailer
Claus Gittinger <cg@exept.de>
parents:
437
diff
changeset
|
483 |
"Modified: 7.9.1996 / 16:01:52 / cg" |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
484 |
! |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
485 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
486 |
initTrailer |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
487 |
"define the documents epilog" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
488 |
|
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
489 |
Trailer := |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
490 |
' |
438
c38453be27ae
put cleanup stuff after %%Trailer
Claus Gittinger <cg@exept.de>
parents:
437
diff
changeset
|
491 |
%%Trailer |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
492 |
EndSmalltalkDoc |
0 | 493 |
SmalltalkJob restore |
494 |
' |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
495 |
|
440 | 496 |
"Modified: 7.9.1996 / 16:27:49 / cg" |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
497 |
! |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
498 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
499 |
initialize |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
500 |
Normal isNil ifTrue:[ |
965
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
501 |
self initFonts. |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
502 |
self initPage. |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
503 |
self initCharacterSize. |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
504 |
|
965
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
505 |
"/ self initProlog. - now done lazy |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
506 |
"/ self initTrailer. - now done lazy |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
507 |
|
965
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
508 |
self initPageProlog. |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
509 |
self initPageTrailer |
170 | 510 |
] |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
511 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
512 |
" |
349 | 513 |
Normal := nil. |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
514 |
self initialize |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
515 |
" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
516 |
|
349 | 517 |
"Modified: 18.5.1996 / 09:46:15 / cg" |
370 | 518 |
! |
519 |
||
520 |
reInitPage |
|
521 |
self initPage. |
|
965
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
522 |
Prolog := nil. |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
523 |
"/ self initProlog. - now done lazy |
370 | 524 |
|
525 |
"Created: 31.5.1996 / 23:35:18 / cg" |
|
526 |
! ! |
|
527 |
||
467 | 528 |
!PostscriptPrinterStream class methodsFor:'accessing - defaults'! |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
529 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
530 |
bottomMargin |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
531 |
"return the bottom margin (in inches)" |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
532 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
533 |
^ BottomMargin |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
534 |
|
378 | 535 |
"Modified: 3.6.1996 / 10:44:44 / cg" |
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
536 |
"Created: 5.9.1996 / 21:42:08 / cg" |
378 | 537 |
! |
538 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
539 |
bottomMargin:inches |
378 | 540 |
"set the bottom margin (in inches)" |
541 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
542 |
BottomMargin := inches. |
378 | 543 |
self reInitPage. |
544 |
||
545 |
"Modified: 3.6.1996 / 10:47:16 / cg" |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
546 |
"Created: 5.9.1996 / 21:42:13 / cg" |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
547 |
! |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
548 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
549 |
leftMargin |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
550 |
"return the left margin (in inches)" |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
551 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
552 |
^ LeftMargin |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
553 |
|
378 | 554 |
"Modified: 3.6.1996 / 10:45:11 / cg" |
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
555 |
"Created: 5.9.1996 / 21:42:16 / cg" |
378 | 556 |
! |
557 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
558 |
leftMargin:inches |
378 | 559 |
"set the left margin (in inches)" |
560 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
561 |
LeftMargin := inches. |
378 | 562 |
self reInitPage. |
563 |
||
564 |
"Created: 3.6.1996 / 10:46:33 / cg" |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
565 |
"Modified: 5.9.1996 / 21:42:19 / cg" |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
566 |
! |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
567 |
|
965
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
568 |
psProlog |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
569 |
Prolog isNil ifTrue:[ |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
570 |
self initProlog |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
571 |
]. |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
572 |
^ Prolog |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
573 |
! |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
574 |
|
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
575 |
psTrailer |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
576 |
Trailer isNil ifTrue:[ |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
577 |
self initTrailer |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
578 |
]. |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
579 |
^ Trailer |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
580 |
! |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
581 |
|
437 | 582 |
resolution |
583 |
"return the printers actual resolution (if known)" |
|
584 |
||
585 |
^ Resolution |
|
586 |
||
587 |
"Modified: 3.6.1996 / 10:45:17 / cg" |
|
588 |
"Created: 5.9.1996 / 21:41:49 / cg" |
|
589 |
! |
|
590 |
||
591 |
resolution:dpiValuePoint |
|
592 |
"set the printers actual resolution (if known)" |
|
593 |
||
594 |
Resolution := dpiValuePoint |
|
595 |
||
596 |
"Modified: 3.6.1996 / 10:45:17 / cg" |
|
597 |
"Created: 5.9.1996 / 21:41:49 / cg" |
|
598 |
! |
|
599 |
||
600 |
rightMargin |
|
601 |
"return the right margin (in inches)" |
|
602 |
||
603 |
^ RightMargin |
|
604 |
||
605 |
"Modified: 3.6.1996 / 10:45:11 / cg" |
|
606 |
"Created: 5.9.1996 / 21:42:16 / cg" |
|
607 |
! |
|
608 |
||
609 |
rightMargin:inches |
|
610 |
"set the right margin (in inches)" |
|
611 |
||
612 |
RightMargin := inches. |
|
613 |
self reInitPage. |
|
614 |
! |
|
615 |
||
431 | 616 |
supportsColor |
617 |
SupportsColor notNil ifTrue:[^ SupportsColor]. |
|
618 |
^ false |
|
619 |
! |
|
620 |
||
621 |
supportsColor:aBoolean |
|
622 |
SupportsColor := aBoolean. |
|
623 |
! |
|
624 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
625 |
topMargin |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
626 |
"return the top margin (in inches)" |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
627 |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
628 |
^ TopMargin |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
629 |
|
378 | 630 |
"Modified: 3.6.1996 / 10:45:17 / cg" |
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
631 |
"Created: 5.9.1996 / 21:41:49 / cg" |
378 | 632 |
! |
633 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
634 |
topMargin:inches |
378 | 635 |
"set the top margin (in inches)" |
636 |
||
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
637 |
TopMargin := inches. |
378 | 638 |
self reInitPage. |
639 |
||
640 |
"Modified: 3.6.1996 / 10:47:26 / cg" |
|
433
2b5b9df0981c
renamed *Inset to *Margin; cleanup.
Claus Gittinger <cg@exept.de>
parents:
432
diff
changeset
|
641 |
"Created: 5.9.1996 / 21:41:55 / cg" |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
642 |
! ! |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
643 |
|
467 | 644 |
!PostscriptPrinterStream class methodsFor:'queries'! |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
645 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
646 |
printerTypeName |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
647 |
"return a descriptive name" |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
648 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
649 |
^ 'postscript printer' |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
650 |
! |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
651 |
|
378 | 652 |
supportsMargins |
653 |
"return true if this printer supports margins" |
|
654 |
||
655 |
^ true |
|
656 |
||
657 |
"Created: 3.6.1996 / 10:48:04 / cg" |
|
658 |
! |
|
659 |
||
368
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
361
diff
changeset
|
660 |
supportsPageSizes |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
361
diff
changeset
|
661 |
"return true if this printer supports different page sizes" |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
361
diff
changeset
|
662 |
|
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
361
diff
changeset
|
663 |
^ true |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
361
diff
changeset
|
664 |
|
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
361
diff
changeset
|
665 |
"Created: 31.5.1996 / 22:35:39 / cg" |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
361
diff
changeset
|
666 |
! |
423cf3f4e522
added query if printer supports pages at all (only PS does)
Claus Gittinger <cg@exept.de>
parents:
361
diff
changeset
|
667 |
|
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
668 |
supportsPostscript |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
669 |
"return true if this is a postscript printer" |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
670 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
671 |
^ true |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
672 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
673 |
"Created: 10.2.1996 / 16:23:23 / cg" |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
674 |
! ! |
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
675 |
|
879 | 676 |
!PostscriptPrinterStream methodsFor:'access-writing'! |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
677 |
|
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
678 |
cr |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
679 |
"send line termination" |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
680 |
|
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
681 |
self flushLine. |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
682 |
native == true ifTrue:[^ super cr]. |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
683 |
|
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
684 |
xPos := LeftX. |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
685 |
colNr := 0. |
1075 | 686 |
sendXPosition := true. |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
687 |
yPos := yPos - FontHeight. |
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
688 |
|
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
689 |
lineNr := lineNr + 1. |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
690 |
lineNr > LinesPerPage ifTrue:[ |
1075 | 691 |
self nextPage |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
692 |
] |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
693 |
|
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
694 |
"Modified: 1.6.1996 / 13:09:30 / cg" |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
695 |
! |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
696 |
|
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
697 |
nextPut:aCharacter |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
698 |
|code| |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
699 |
|
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
700 |
(aCharacter == Character cr) ifTrue:[ |
913
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
701 |
^ self cr |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
702 |
]. |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
703 |
|
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
704 |
native == true ifTrue:[ |
913
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
705 |
^ super nextPut:aCharacter |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
706 |
]. |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
707 |
|
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
708 |
(aCharacter == $( ) ifTrue:[ |
1075 | 709 |
lineStream nextPutAll:'\(' . |
913
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
710 |
^ self |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
711 |
]. |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
712 |
(aCharacter == $) ) ifTrue:[ |
1075 | 713 |
lineStream nextPutAll:'\)' . |
913
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
714 |
^ self |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
715 |
]. |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
716 |
(aCharacter == $\ ) ifTrue:[ |
1075 | 717 |
lineStream nextPutAll:'\\' . |
913
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
718 |
^ self |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
719 |
]. |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
720 |
|
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
721 |
(aCharacter == Character tab ) ifTrue:[ |
913
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
722 |
self flushLine. |
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
723 |
colNr := ((colNr + 8) // 8) * 8. |
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
724 |
xPos := LeftX + (colNr * FontWidth). |
1075 | 725 |
sendXPosition := true. |
913
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
726 |
^ self |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
727 |
]. |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
728 |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
729 |
(code := aCharacter asciiValue) > 16r7F ifTrue:[ |
1075 | 730 |
lineStream nextPut:$\ ; nextPutAll:(code printStringRadix:8) |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
731 |
] ifFalse:[ |
1075 | 732 |
lineStream nextPut:aCharacter |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
733 |
]. |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
734 |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
735 |
"Modified: 23.4.1996 / 20:05:59 / cg" |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
736 |
! ! |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
737 |
|
361 | 738 |
!PostscriptPrinterStream methodsFor:'accessing'! |
739 |
||
467 | 740 |
colNr |
741 |
"return the current column-Nr (within the line)" |
|
742 |
||
743 |
^ colNr |
|
744 |
||
745 |
"Created: 2.1.1997 / 13:29:55 / cg" |
|
746 |
! |
|
747 |
||
748 |
lineNr |
|
749 |
"return the current line-Nr (within the page)" |
|
750 |
||
751 |
^ lineNr |
|
752 |
||
753 |
"Created: 2.1.1997 / 13:29:38 / cg" |
|
754 |
! |
|
755 |
||
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
756 |
pageCount |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
757 |
"returns the number of the currently printed page" |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
758 |
|
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
759 |
^ pageCount |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
760 |
|
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
761 |
"Created: 5.9.1996 / 18:29:23 / cg" |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
762 |
! |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
763 |
|
361 | 764 |
pageEndAction:something |
765 |
"set pageEndAction - if non-nil, that will be called before |
|
766 |
and EndPage is emmitted. |
|
767 |
An example use is a private block, |
|
768 |
which draws a company frame around the page ..." |
|
769 |
||
770 |
pageEndAction := something. |
|
771 |
||
772 |
"Modified: 30.5.1996 / 16:45:09 / ca" |
|
773 |
! |
|
774 |
||
775 |
pageStartAction:something |
|
776 |
"set pageStartAction - if nonNil, that is evaluated prior to every page." |
|
777 |
||
778 |
pageStartAction := something. |
|
779 |
||
780 |
"Modified: 30.5.1996 / 16:44:20 / ca" |
|
781 |
! ! |
|
782 |
||
348 | 783 |
!PostscriptPrinterStream methodsFor:'emphasis change'! |
784 |
||
785 |
bold |
|
786 |
"further printing is in bold" |
|
787 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
788 |
(fStyle ~~ Bold) ifTrue:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
789 |
self flushLine. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
790 |
fStyle := Bold. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
791 |
self setFont. |
382 | 792 |
]. |
348 | 793 |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
794 |
"Modified: 8.6.1996 / 08:17:15 / cg" |
348 | 795 |
! |
796 |
||
349 | 797 |
boldItalic |
798 |
"further printing is in boldItalic" |
|
799 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
800 |
(fStyle ~~ BoldItalic) ifTrue:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
801 |
self flushLine. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
802 |
fStyle := BoldItalic. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
803 |
self setFont. |
382 | 804 |
]. |
349 | 805 |
|
806 |
"Created: 18.5.1996 / 09:36:36 / cg" |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
807 |
"Modified: 8.6.1996 / 08:17:21 / cg" |
349 | 808 |
! |
809 |
||
348 | 810 |
italic |
811 |
"further printing is in italic" |
|
812 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
813 |
(fStyle ~~ Italic) ifTrue:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
814 |
self flushLine. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
815 |
fStyle := Italic. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
816 |
self setFont. |
382 | 817 |
]. |
348 | 818 |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
819 |
"Modified: 8.6.1996 / 08:17:28 / cg" |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
820 |
! |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
821 |
|
391 | 822 |
noStrikeout |
823 |
"further printing is not strikedout" |
|
824 |
||
825 |
strikeout ifTrue:[ |
|
826 |
self flushLine. |
|
827 |
strikeout := false |
|
828 |
] |
|
829 |
||
830 |
"Modified: 8.6.1996 / 08:15:56 / cg" |
|
831 |
"Created: 8.6.1996 / 08:16:35 / cg" |
|
832 |
! |
|
833 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
834 |
noUnderline |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
835 |
"further printing is not underlined" |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
836 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
837 |
underline ifTrue:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
838 |
self flushLine. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
839 |
underline := false |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
840 |
] |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
841 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
842 |
"Created: 8.6.1996 / 08:11:07 / cg" |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
843 |
"Modified: 8.6.1996 / 08:15:56 / cg" |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
844 |
! |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
845 |
|
348 | 846 |
normal |
847 |
"further printing is in normal style (i.e. non-bold/non-italic)" |
|
848 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
849 |
(fStyle ~~ Normal) ifTrue:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
850 |
self flushLine. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
851 |
fStyle := Normal. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
852 |
self setFont. |
380 | 853 |
]. |
348 | 854 |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
855 |
"Modified: 8.6.1996 / 08:17:34 / cg" |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
856 |
! |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
857 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
858 |
strikeout |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
859 |
"further printing is strikedout" |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
860 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
861 |
strikeout ifFalse:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
862 |
self flushLine. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
863 |
strikeout := true |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
864 |
] |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
865 |
|
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
866 |
"Modified: 8.6.1996 / 08:10:49 / cg" |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
867 |
"Created: 8.6.1996 / 08:16:18 / cg" |
382 | 868 |
! |
869 |
||
870 |
underline |
|
871 |
"further printing is underlined" |
|
872 |
||
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
873 |
underline ifFalse:[ |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
874 |
self flushLine. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
875 |
underline := true |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
876 |
] |
382 | 877 |
|
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
878 |
"Modified: 8.6.1996 / 08:16:05 / cg" |
348 | 879 |
! ! |
880 |
||
881 |
!PostscriptPrinterStream methodsFor:'font change'! |
|
882 |
||
883 |
courier |
|
884 |
"further printing is in the courier font" |
|
885 |
||
886 |
self flushLine. |
|
887 |
fFamily := Courier. |
|
888 |
self setFont |
|
889 |
||
890 |
"Modified: 10.4.1996 / 13:34:49 / cg" |
|
891 |
! |
|
892 |
||
893 |
helvetica |
|
894 |
"further printing is in the helvetica font" |
|
895 |
||
896 |
self flushLine. |
|
897 |
fFamily := Helvetica. |
|
898 |
self setFont |
|
899 |
||
900 |
"Modified: 10.4.1996 / 13:34:58 / cg" |
|
901 |
! |
|
902 |
||
903 |
times |
|
904 |
"further printing is in the times font" |
|
905 |
||
906 |
self flushLine. |
|
907 |
fFamily := Times. |
|
908 |
self setFont |
|
909 |
||
910 |
"Modified: 10.4.1996 / 13:36:07 / cg" |
|
911 |
! ! |
|
912 |
||
126 | 913 |
!PostscriptPrinterStream methodsFor:'open/close'! |
914 |
||
915 |
endPrint |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
916 |
"finish a document - finish page; then send documentTrailer. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
917 |
Send nothing if nativePrinting." |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
918 |
|
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
919 |
native == true ifFalse:[ |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
920 |
self endPage. |
965
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
921 |
super nextPutAllUntranslated:(self class psTrailer). |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
922 |
super nextPutAllUntranslated:'%%Pages: ' , pageCount printString. |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
923 |
super nextPutUntranslated:(Character cr). |
440 | 924 |
super nextPutAllUntranslated:'%%EOF'. |
925 |
super nextPutUntranslated:(Character cr). |
|
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
926 |
]. |
126 | 927 |
super endPrint |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
928 |
|
440 | 929 |
"Modified: 7.9.1996 / 16:28:20 / cg" |
0 | 930 |
! |
931 |
||
913
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
932 |
setNative:aBoolean |
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
933 |
|
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
934 |
aBoolean ifTrue:[self flushLine]. |
965
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
935 |
super setNative:aBoolean. |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
936 |
! |
913
99228537653d
Speed up native printing: #nextPutAll
Stefan Vogel <sv@exept.de>
parents:
879
diff
changeset
|
937 |
|
126 | 938 |
startPrint |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
939 |
"start a document - send documentProlog & start a page. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
940 |
Send nothing if nativePrinting." |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
941 |
|
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
942 |
pageCount := 1. |
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
943 |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
944 |
fFamily := Courier. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
945 |
fStyle := Normal. |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
946 |
underline := false. |
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
947 |
strikeout := false. |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
948 |
|
914 | 949 |
super startPrint. |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
950 |
native == true ifFalse:[ |
965
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
951 |
super nextPutAllUntranslated:(self class psProlog). |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
952 |
self startPage |
222
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
953 |
] |
15d1c9a82bc6
suppress trailer in native printing (used to disturb the output of html printouts)
Claus Gittinger <cg@exept.de>
parents:
186
diff
changeset
|
954 |
|
965
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
955 |
"Modified: / 26.5.1999 / 16:15:27 / cg" |
21f25a87c5c6
prolog initialization now lazy (when needed, not when class is initialized)
Claus Gittinger <cg@exept.de>
parents:
914
diff
changeset
|
956 |
! ! |
126 | 957 |
|
958 |
!PostscriptPrinterStream methodsFor:'private'! |
|
959 |
||
960 |
endPage |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
961 |
"end a page - flush buffered text & send pageTrailer" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
962 |
|
0 | 963 |
self flushLine. |
361 | 964 |
pageEndAction notNil ifTrue:[ |
390
3f22865fa873
fixed handling of underline; no longer affects bold/italic setting.
Claus Gittinger <cg@exept.de>
parents:
386
diff
changeset
|
965 |
pageEndAction value |
361 | 966 |
]. |
126 | 967 |
super nextPutAllUntranslated:PageTrailer |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
968 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
969 |
"Modified: 23.4.1996 / 20:00:01 / cg" |
0 | 970 |
! |
971 |
||
126 | 972 |
flushLine |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
973 |
"flush buffered line text" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
974 |
|
1075 | 975 |
|lineBuffer| |
976 |
||
1091 | 977 |
lineStream isNil ifTrue:[^ self]. |
978 |
||
1075 | 979 |
lineBuffer := lineStream contents. |
391 | 980 |
|
126 | 981 |
(lineBuffer size > 0) ifTrue:[ |
1075 | 982 |
sendXPosition ifTrue:[ |
983 |
self nextPutAllUntranslated:(xPos printString). |
|
984 |
self nextPutUntranslated:Character space. |
|
985 |
self nextPutAllUntranslated:(yPos printString). |
|
391 | 986 |
]. |
1075 | 987 |
self nextPutUntranslated:$(. |
988 |
self nextPutAllUntranslated:lineBuffer. |
|
989 |
self nextPutUntranslated:$). |
|
391 | 990 |
sendXPosition ifTrue:[ |
1075 | 991 |
self nextPutUntranslated:$B. |
992 |
sendXPosition := false. |
|
391 | 993 |
] ifFalse:[ |
1075 | 994 |
self nextPutUntranslated:$S. |
391 | 995 |
]. |
996 |
underline == true ifTrue:[ |
|
1075 | 997 |
self nextPutAllUntranslated:'UL'. |
391 | 998 |
] ifFalse:[ |
999 |
strikeout == true ifTrue:[ |
|
1075 | 1000 |
self nextPutAllUntranslated:'SO'. |
391 | 1001 |
] |
1002 |
]. |
|
1003 |
||
1075 | 1004 |
self nextPutUntranslated:(Character cr). |
391 | 1005 |
xPos := xPos + (FontWidth * lineBuffer size). |
1006 |
colNr := colNr + lineBuffer size |
|
126 | 1007 |
]. |
866 | 1008 |
self flush. |
1075 | 1009 |
lineStream reset. |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1010 |
|
391 | 1011 |
"Modified: 8.6.1996 / 11:40:29 / cg" |
126 | 1012 |
! |
1013 |
||
1014 |
nextPage |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1015 |
"new page - finish previous page & start enew. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1016 |
Should not be sent when nativePrinting." |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1017 |
|
126 | 1018 |
self endPage. |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
1019 |
|
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
1020 |
pageCount := pageCount + 1. |
126 | 1021 |
self startPage |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1022 |
|
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
1023 |
"Modified: 5.9.1996 / 18:30:00 / cg" |
0 | 1024 |
! |
1025 |
||
361 | 1026 |
placeString:aString at:pos |
1027 |
"special entry: place a string at some particular position in my ps-coordinate |
|
1028 |
system. Can be used with endPageActions to place a page-number." |
|
1029 |
||
1075 | 1030 |
self flushLine; |
1031 |
nextPutAllUntranslated:(pos x printString); |
|
1032 |
nextPutUntranslated:Character space; |
|
1033 |
nextPutAllUntranslated:(pos y printString); |
|
1034 |
nextPutUntranslated:$(; |
|
1035 |
nextPutAllUntranslated:aString; |
|
1036 |
nextPutAllUntranslated:')B'; |
|
1037 |
nextPutUntranslated:(Character cr). |
|
361 | 1038 |
|
1039 |
"Created: 30.5.1996 / 17:06:36 / ca" |
|
1040 |
! |
|
1041 |
||
126 | 1042 |
setFont |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1043 |
"change the font. |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1044 |
Uses current fFamily and fStyle (which give the fonts nr)" |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1045 |
|
126 | 1046 |
|fontNumber| |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1047 |
|
126 | 1048 |
fontNumber := fFamily + fStyle. |
1075 | 1049 |
self nextPutAllUntranslated:fontNumber printString; |
1050 |
nextPutAllUntranslated:' F'; |
|
1051 |
nextPutUntranslated:(Character cr). |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1052 |
|
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1053 |
"Modified: 23.4.1996 / 20:01:28 / cg" |
0 | 1054 |
! |
1055 |
||
126 | 1056 |
startPage |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1057 |
"start a page - send pageProlog, reset x/y position and line/col." |
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1058 |
|
1075 | 1059 |
self nextPutAllUntranslated:'%%Page: ' , pageCount printString , ' ' , pageCount printString. |
1060 |
self nextPutUntranslated:(Character cr). |
|
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
1061 |
|
361 | 1062 |
pageStartAction notNil ifTrue:[ |
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
1063 |
pageStartAction value |
361 | 1064 |
]. |
1075 | 1065 |
self nextPutAllUntranslated:PageProlog. |
373 | 1066 |
self class landscape ifTrue:[ |
1075 | 1067 |
self nextPutAllUntranslated:'Landscape |
373 | 1068 |
'. |
1069 |
]. |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1070 |
|
126 | 1071 |
self setFont. |
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1072 |
|
126 | 1073 |
yPos := TopY. |
1074 |
xPos := LeftX. |
|
1075 | 1075 |
lineStream isNil ifTrue:[ |
1076 |
lineStream := WriteStream on:''. |
|
1077 |
] ifFalse:[ |
|
1078 |
lineStream reset. |
|
1079 |
]. |
|
126 | 1080 |
lineNr := 1. |
1075 | 1081 |
colNr := 0. |
1082 |
sendXPosition := true. |
|
246
ba03a2af594c
fixed ISO-latin1 encoding (national characters)
Claus Gittinger <cg@exept.de>
parents:
223
diff
changeset
|
1083 |
|
432
c8b2fa21b747
count pages (for ghostview to be able to page)
Claus Gittinger <cg@exept.de>
parents:
431
diff
changeset
|
1084 |
"Modified: 5.9.1996 / 18:30:08 / cg" |
0 | 1085 |
! ! |
126 | 1086 |
|
361 | 1087 |
!PostscriptPrinterStream methodsFor:'queries'! |
1088 |
||
1089 |
fontHeight |
|
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1090 |
"the used fonts height in my postscript coordinate system |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1091 |
(i.e. in twips, which is 1/20th of a point)" |
361 | 1092 |
|
1093 |
^ FontHeight |
|
1094 |
||
1095 |
"Modified: 30.5.1996 / 16:47:37 / ca" |
|
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1096 |
"Modified: 1.6.1996 / 13:14:51 / cg" |
361 | 1097 |
! |
1098 |
||
1099 |
leftX |
|
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1100 |
"the left x startPosition (i.e. leftMargin) in my postscript coordinate system. |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1101 |
(i.e. in twips, which is 1/20th of a point)" |
361 | 1102 |
|
1103 |
^ LeftX |
|
1104 |
||
1105 |
"Modified: 30.5.1996 / 16:48:56 / ca" |
|
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1106 |
"Modified: 1.6.1996 / 13:14:59 / cg" |
361 | 1107 |
! |
1108 |
||
1109 |
linesPerPage |
|
1110 |
"the number of lines per page" |
|
1111 |
||
1112 |
^ LinesPerPage |
|
1113 |
||
1114 |
"Modified: 30.5.1996 / 16:48:20 / ca" |
|
1115 |
! |
|
1116 |
||
1117 |
overAllPageSize |
|
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1118 |
"the overAll pageSize in my postscript coordinate system. |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1119 |
(i.e. in twips, which is 1/20th of a point)" |
361 | 1120 |
|
1121 |
^ PageHeight |
|
1122 |
||
1123 |
"Created: 30.5.1996 / 16:56:51 / ca" |
|
1124 |
"Modified: 30.5.1996 / 16:58:01 / ca" |
|
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1125 |
"Modified: 1.6.1996 / 13:15:06 / cg" |
361 | 1126 |
! |
1127 |
||
1128 |
topY |
|
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1129 |
"the top y startPosition (i.e. page-size - topMargin) in my own coordinate system |
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1130 |
(i.e. in twips, which is 1/20th of a point)" |
361 | 1131 |
|
1132 |
^ TopY |
|
1133 |
||
1134 |
"Modified: 30.5.1996 / 16:48:48 / ca" |
|
375
ab43222a70ce
added access methods for margins
Claus Gittinger <cg@exept.de>
parents:
373
diff
changeset
|
1135 |
"Modified: 1.6.1996 / 13:15:23 / cg" |
361 | 1136 |
! ! |
1137 |
||
467 | 1138 |
!PostscriptPrinterStream class methodsFor:'documentation'! |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
1139 |
|
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
1140 |
version |
1091 | 1141 |
^ '$Header: /cvs/stx/stx/libbasic2/PostscriptPrinterStream.st,v 1.57 2002-09-24 13:56:00 tm Exp $' |
186
bc1b056b097c
added #supportsPostscript query
Claus Gittinger <cg@exept.de>
parents:
179
diff
changeset
|
1142 |
! ! |
1091 | 1143 |
|
126 | 1144 |
PostscriptPrinterStream initialize! |