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