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