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