blob: 46362cb9f7c8f52ae8ee352d81db4bd42bfe26a8 [file] [log] [blame]
Alexander Belopolsky14fb7992010-11-09 18:40:03 +00001%!PS-Adobe-3.0 EPSF-3.0
2%%Creator: Tk Canvas Widget
3%%For: Alexander Belopolsky
4%%Title: Window .4315905424
5%%CreationDate: Tue Nov 9 12:54:06 2010
6%%XBoundingBox: -172 -52 785 845
7%%BoundingBox: 290 290 520 520
8%%Pages: 1
9%%DocumentData: Clean7Bit
10%%Orientation: Portrait
11%%EndComments
12
13%%BeginProlog
14/CurrentEncoding [
15/space/space/space/space/space/space/space/space
16/space/space/space/space/space/space/space/space
17/space/space/space/space/space/space/space/space
18/space/space/space/space/space/space/space/space
19/space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quotesingle
20/parenleft/parenright/asterisk/plus/comma/hyphen/period/slash
21/zero/one/two/three/four/five/six/seven
22/eight/nine/colon/semicolon/less/equal/greater/question
23/at/A/B/C/D/E/F/G
24/H/I/J/K/L/M/N/O
25/P/Q/R/S/T/U/V/W
26/X/Y/Z/bracketleft/backslash/bracketright/asciicircum/underscore
27/grave/a/b/c/d/e/f/g
28/h/i/j/k/l/m/n/o
29/p/q/r/s/t/u/v/w
30/x/y/z/braceleft/bar/braceright/asciitilde/space
31/space/space/space/space/space/space/space/space
32/space/space/space/space/space/space/space/space
33/space/space/space/space/space/space/space/space
34/space/space/space/space/space/space/space/space
35/space/exclamdown/cent/sterling/currency/yen/brokenbar/section
36/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/hyphen/registered/macron
37/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph/periodcentered
38/cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown
39/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
40/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis
41/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply
42/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
43/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
44/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
45/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide
46/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis
47] def
48
4950 dict begin
50% This is a standard prolog for Postscript generated by Tk's canvas
51% widget.
52% RCS: @(#) $Id$
53
54% The definitions below just define all of the variables used in
55% any of the procedures here. This is needed for obscure reasons
56% explained on p. 716 of the Postscript manual (Section H.2.7,
57% "Initializing Variables," in the section on Encapsulated Postscript).
58
59/baseline 0 def
60/stipimage 0 def
61/height 0 def
62/justify 0 def
63/lineLength 0 def
64/spacing 0 def
65/stipple 0 def
66/strings 0 def
67/xoffset 0 def
68/yoffset 0 def
69/tmpstip null def
70
71
72/cstringshow {
73 {
74 dup type /stringtype eq
75 { show } { glyphshow }
76 ifelse
77 }
78 forall
79} bind def
80
81
82
83/cstringwidth {
84 0 exch 0 exch
85 {
86 dup type /stringtype eq
87 { stringwidth } {
88 currentfont /Encoding get exch 1 exch put (\001) stringwidth
89 }
90 ifelse
91 exch 3 1 roll add 3 1 roll add exch
92 }
93 forall
94} bind def
95
96% font ISOEncode font
97% This procedure changes the encoding of a font from the default
98% Postscript encoding to current system encoding. It's typically invoked just
99% before invoking "setfont". The body of this procedure comes from
100% Section 5.6.1 of the Postscript book.
101
102/ISOEncode {
103 dup length dict begin
104 {1 index /FID ne {def} {pop pop} ifelse} forall
105 /Encoding CurrentEncoding def
106 currentdict
107 end
108
109 % I'm not sure why it's necessary to use "definefont" on this new
110 % font, but it seems to be important; just use the name "Temporary"
111 % for the font.
112
113 /Temporary exch definefont
114} bind def
115
116% StrokeClip
117%
118% This procedure converts the current path into a clip area under
119% the assumption of stroking. It's a bit tricky because some Postscript
120% interpreters get errors during strokepath for dashed lines. If
121% this happens then turn off dashes and try again.
122
123/StrokeClip {
124 {strokepath} stopped {
125 (This Postscript printer gets limitcheck overflows when) =
126 (stippling dashed lines; lines will be printed solid instead.) =
127 [] 0 setdash strokepath} if
128 clip
129} bind def
130
131% desiredSize EvenPixels closestSize
132%
133% The procedure below is used for stippling. Given the optimal size
134% of a dot in a stipple pattern in the current user coordinate system,
135% compute the closest size that is an exact multiple of the device's
136% pixel size. This allows stipple patterns to be displayed without
137% aliasing effects.
138
139/EvenPixels {
140 % Compute exact number of device pixels per stipple dot.
141 dup 0 matrix currentmatrix dtransform
142 dup mul exch dup mul add sqrt
143
144 % Round to an integer, make sure the number is at least 1, and compute
145 % user coord distance corresponding to this.
146 dup round dup 1 lt {pop 1} if
147 exch div mul
148} bind def
149
150% width height string StippleFill --
151%
152% Given a path already set up and a clipping region generated from
153% it, this procedure will fill the clipping region with a stipple
154% pattern. "String" contains a proper image description of the
155% stipple pattern and "width" and "height" give its dimensions. Each
156% stipple dot is assumed to be about one unit across in the current
157% user coordinate system. This procedure trashes the graphics state.
158
159/StippleFill {
160 % The following code is needed to work around a NeWSprint bug.
161
162 /tmpstip 1 index def
163
164 % Change the scaling so that one user unit in user coordinates
165 % corresponds to the size of one stipple dot.
166 1 EvenPixels dup scale
167
168 % Compute the bounding box occupied by the path (which is now
169 % the clipping region), and round the lower coordinates down
170 % to the nearest starting point for the stipple pattern. Be
171 % careful about negative numbers, since the rounding works
172 % differently on them.
173
174 pathbbox
175 4 2 roll
176 5 index div dup 0 lt {1 sub} if cvi 5 index mul 4 1 roll
177 6 index div dup 0 lt {1 sub} if cvi 6 index mul 3 2 roll
178
179 % Stack now: width height string y1 y2 x1 x2
180 % Below is a doubly-nested for loop to iterate across this area
181 % in units of the stipple pattern size, going up columns then
182 % across rows, blasting out a stipple-pattern-sized rectangle at
183 % each position
184
185 6 index exch {
186 2 index 5 index 3 index {
187 % Stack now: width height string y1 y2 x y
188
189 gsave
190 1 index exch translate
191 5 index 5 index true matrix tmpstip imagemask
192 grestore
193 } for
194 pop
195 } for
196 pop pop pop pop pop
197} bind def
198
199% -- AdjustColor --
200% Given a color value already set for output by the caller, adjusts
201% that value to a grayscale or mono value if requested by the CL
202% variable.
203
204/AdjustColor {
205 CL 2 lt {
206 currentgray
207 CL 0 eq {
208 .5 lt {0} {1} ifelse
209 } if
210 setgray
211 } if
212} bind def
213
214% x y strings spacing xoffset yoffset justify stipple DrawText --
215% This procedure does all of the real work of drawing text. The
216% color and font must already have been set by the caller, and the
217% following arguments must be on the stack:
218%
219% x, y - Coordinates at which to draw text.
220% strings - An array of strings, one for each line of the text item,
221% in order from top to bottom.
222% spacing - Spacing between lines.
223% xoffset - Horizontal offset for text bbox relative to x and y: 0 for
224% nw/w/sw anchor, -0.5 for n/center/s, and -1.0 for ne/e/se.
225% yoffset - Vertical offset for text bbox relative to x and y: 0 for
226% nw/n/ne anchor, +0.5 for w/center/e, and +1.0 for sw/s/se.
227% justify - 0 for left justification, 0.5 for center, 1 for right justify.
228% stipple - Boolean value indicating whether or not text is to be
229% drawn in stippled fashion. If text is stippled,
230% procedure StippleText must have been defined to call
231% StippleFill in the right way.
232%
233% Also, when this procedure is invoked, the color and font must already
234% have been set for the text.
235
236/DrawText {
237 /stipple exch def
238 /justify exch def
239 /yoffset exch def
240 /xoffset exch def
241 /spacing exch def
242 /strings exch def
243
244 % First scan through all of the text to find the widest line.
245
246 /lineLength 0 def
247 strings {
248 cstringwidth pop
249 dup lineLength gt {/lineLength exch def} {pop} ifelse
250 newpath
251 } forall
252
253 % Compute the baseline offset and the actual font height.
254
255 0 0 moveto (TXygqPZ) false charpath
256 pathbbox dup /baseline exch def
257 exch pop exch sub /height exch def pop
258 newpath
259
260 % Translate coordinates first so that the origin is at the upper-left
261 % corner of the text's bounding box. Remember that x and y for
262 % positioning are still on the stack.
263
264 translate
265 lineLength xoffset mul
266 strings length 1 sub spacing mul height add yoffset mul translate
267
268 % Now use the baseline and justification information to translate so
269 % that the origin is at the baseline and positioning point for the
270 % first line of text.
271
272 justify lineLength mul baseline neg translate
273
274 % Iterate over each of the lines to output it. For each line,
275 % compute its width again so it can be properly justified, then
276 % display it.
277
278 strings {
279 dup cstringwidth pop
280 justify neg mul 0 moveto
281 stipple {
282
283
284 % The text is stippled, so turn it into a path and print
285 % by calling StippledText, which in turn calls StippleFill.
286 % Unfortunately, many Postscript interpreters will get
287 % overflow errors if we try to do the whole string at
288 % once, so do it a character at a time.
289
290 gsave
291 /char (X) def
292 {
293 dup type /stringtype eq {
294 % This segment is a string.
295 {
296 char 0 3 -1 roll put
297 currentpoint
298 gsave
299 char true charpath clip StippleText
300 grestore
301 char stringwidth translate
302 moveto
303 } forall
304 } {
305 % This segment is glyph name
306 % Temporary override
307 currentfont /Encoding get exch 1 exch put
308 currentpoint
309 gsave (\001) true charpath clip StippleText
310 grestore
311 (\001) stringwidth translate
312 moveto
313 } ifelse
314 } forall
315 grestore
316 } {cstringshow} ifelse
317 0 spacing neg translate
318 } forall
319} bind def
320
321%%EndProlog
322%%BeginSetup
323/CL 2 def
324%%EndSetup
325
326%%Page: 1 1
327save
328306.0 396.0 translate
3290.9995 0.9995 scale
3304 -449 translate
331-483 898 moveto 475 898 lineto 475 0 lineto -483 0 lineto closepath clip newpath
332gsave
333grestore
334gsave
3350 445 moveto
336200 445 lineto
3373.03844939755837 479.729635533386 lineto
338190.97697355474 411.325606868252 lineto
33917.7718927978523 511.325606868252 lineto
340170.980781421648 382.768084930944 lineto
34142.42325948434 535.97697355474 lineto
342142.42325948434 362.771892797852 lineto
34374.0192308192062 550.710416955034 lineto
344108.748866352592 353.748866352592 lineto
345108.748866352592 553.748866352592 lineto
34674.0192308192064 356.787315750151 lineto
347142.42325948434 544.725839907333 lineto
34842.4232594843401 371.520759150445 lineto
349170.980781421648 524.72964777424 lineto
35017.7718927978524 396.172125836932 lineto
351190.97697355474 496.172125836933 lineto
3523.03844939755834 427.768097171799 lineto
353200 462.497732705185 lineto
354-1.13686837721616e-13 462.497732705185 lineto
355196.961550602442 427.768097171799 lineto
3569.02302644525972 496.172125836932 lineto
357182.228107202148 396.172125836933 lineto
35829.0192185783518 524.72964777424 lineto
359157.57674051566 371.520759150445 lineto
36057.5767405156596 544.725839907332 lineto
361125.980769180794 356.787315750151 lineto
36291.2511336474073 553.748866352592 lineto
36391.2511336474079 353.748866352592 lineto
364125.980769180793 550.710416955034 lineto
36557.5767405156601 362.771892797852 lineto
366157.57674051566 535.97697355474 lineto
36729.0192185783522 382.768084930944 lineto
368182.228107202148 511.325606868253 lineto
3699.02302644525994 411.325606868252 lineto
370196.961550602442 479.729635533386 lineto
371-1.70530256582424e-13 445 lineto
3720 445 lineto
3731.000 1.000 0.000 setrgbcolor AdjustColor
374eofill
375grestore
376gsave
3770 445 moveto
378200 445 lineto
3793.03844939755837 479.729635533386 lineto
380190.97697355474 411.325606868252 lineto
38117.7718927978523 511.325606868252 lineto
382170.980781421648 382.768084930944 lineto
38342.42325948434 535.97697355474 lineto
384142.42325948434 362.771892797852 lineto
38574.0192308192062 550.710416955034 lineto
386108.748866352592 353.748866352592 lineto
387108.748866352592 553.748866352592 lineto
38874.0192308192064 356.787315750151 lineto
389142.42325948434 544.725839907333 lineto
39042.4232594843401 371.520759150445 lineto
391170.980781421648 524.72964777424 lineto
39217.7718927978524 396.172125836932 lineto
393190.97697355474 496.172125836933 lineto
3943.03844939755834 427.768097171799 lineto
395200 462.497732705185 lineto
396-1.13686837721616e-13 462.497732705185 lineto
397196.961550602442 427.768097171799 lineto
3989.02302644525972 496.172125836932 lineto
399182.228107202148 396.172125836933 lineto
40029.0192185783518 524.72964777424 lineto
401157.57674051566 371.520759150445 lineto
40257.5767405156596 544.725839907332 lineto
403125.980769180794 356.787315750151 lineto
40491.2511336474073 553.748866352592 lineto
40591.2511336474079 353.748866352592 lineto
406125.980769180793 550.710416955034 lineto
40757.5767405156601 362.771892797852 lineto
408157.57674051566 535.97697355474 lineto
40929.0192185783522 382.768084930944 lineto
410182.228107202148 511.325606868253 lineto
4119.02302644525994 411.325606868252 lineto
412196.961550602442 479.729635533386 lineto
413-1.70530256582424e-13 445 lineto
4141 setlinecap
4151 setlinejoin
4161 setlinewidth
417[] 0 setdash
4181.000 0.000 0.000 setrgbcolor AdjustColor
419stroke
420grestore
421gsave
422grestore
423gsave
424-1.70530256582424e-13 445 moveto
425-9.00000000000019 450 lineto
426-7.00000000000017 445 lineto
427-9.00000000000015 440 lineto
428-1.70530256582424e-13 445 lineto
4291.000 1.000 0.000 setrgbcolor AdjustColor
430eofill
431-1.70530256582424e-13 445 moveto
432-9.00000000000019 450 lineto
433-7.00000000000017 445 lineto
434-9.00000000000015 440 lineto
435-1.70530256582424e-13 445 lineto
4361 setlinejoin 1 setlinecap
4371 setlinewidth
438[] 0 setdash
4391.000 0.000 0.000 setrgbcolor AdjustColor
440stroke
441grestore
442restore showpage
443
444%%Trailer
445end
446%%EOF
447