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