Initial release of Maemo 5 port of gnuplot
[gnuplot] / term / PostScript / prologue.ps
1 %
2 % Gnuplot Prolog Version 4.2 (August 2006)
3 %
4 /M {moveto} bind def
5 /L {lineto} bind def
6 /R {rmoveto} bind def
7 /V {rlineto} bind def
8 /N {newpath moveto} bind def
9 /Z {closepath} bind def
10 /C {setrgbcolor} bind def
11 /f {rlineto fill} bind def
12 /vpt2 vpt 2 mul def
13 /hpt2 hpt 2 mul def
14 /Lshow {currentpoint stroke M 0 vshift R 
15         Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
16 /Rshow {currentpoint stroke M dup stringwidth pop neg vshift R
17         Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
18 /Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R 
19         Blacktext {gsave 0 setgray show grestore} {show} ifelse} def
20 /UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
21   /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def
22 /DL {Color {setrgbcolor Solid {pop []} if 0 setdash}
23  {pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse} def
24 /BL {stroke userlinewidth 2 mul setlinewidth
25         Rounded {1 setlinejoin 1 setlinecap} if} def
26 /AL {stroke userlinewidth 2 div setlinewidth
27         Rounded {1 setlinejoin 1 setlinecap} if} def
28 /UL {dup gnulinewidth mul /userlinewidth exch def
29         dup 1 lt {pop 1} if 10 mul /udl exch def} def
30 /PL {stroke userlinewidth setlinewidth
31         Rounded {1 setlinejoin 1 setlinecap} if} def
32 % Default Line colors
33 /LCw {1 1 1} def
34 /LCb {0 0 0} def
35 /LCa {0 0 0} def
36 /LC0 {1 0 0} def
37 /LC1 {0 1 0} def
38 /LC2 {0 0 1} def
39 /LC3 {1 0 1} def
40 /LC4 {0 1 1} def
41 /LC5 {1 1 0} def
42 /LC6 {0 0 0} def
43 /LC7 {1 0.3 0} def
44 /LC8 {0.5 0.5 0.5} def
45 % Default Line Types
46 /LTw {PL [] 1 setgray} def
47 /LTb {BL [] LCb DL} def
48 /LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def
49 /LT0 {PL [] LC0 DL} def
50 /LT1 {PL [4 dl1 2 dl2] LC1 DL} def
51 /LT2 {PL [2 dl1 3 dl2] LC2 DL} def
52 /LT3 {PL [1 dl1 1.5 dl2] LC3 DL} def
53 /LT4 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
54 /LT5 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC5 DL} def
55 /LT6 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC6 DL} def
56 /LT7 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC7 DL} def
57 /LT8 {PL [2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 2 dl2 2 dl1 4 dl2] LC8 DL} def
58 /Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def
59 /Dia {stroke [] 0 setdash 2 copy vpt add M
60   hpt neg vpt neg V hpt vpt neg V
61   hpt vpt V hpt neg vpt V closepath stroke
62   Pnt} def
63 /Pls {stroke [] 0 setdash vpt sub M 0 vpt2 V
64   currentpoint stroke M
65   hpt neg vpt neg R hpt2 0 V stroke
66  } def
67 /Box {stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M
68   0 vpt2 neg V hpt2 0 V 0 vpt2 V
69   hpt2 neg 0 V closepath stroke
70   Pnt} def
71 /Crs {stroke [] 0 setdash exch hpt sub exch vpt add M
72   hpt2 vpt2 neg V currentpoint stroke M
73   hpt2 neg 0 R hpt2 vpt2 V stroke} def
74 /TriU {stroke [] 0 setdash 2 copy vpt 1.12 mul add M
75   hpt neg vpt -1.62 mul V
76   hpt 2 mul 0 V
77   hpt neg vpt 1.62 mul V closepath stroke
78   Pnt} def
79 /Star {2 copy Pls Crs} def
80 /BoxF {stroke [] 0 setdash exch hpt sub exch vpt add M
81   0 vpt2 neg V hpt2 0 V 0 vpt2 V
82   hpt2 neg 0 V closepath fill} def
83 /TriUF {stroke [] 0 setdash vpt 1.12 mul add M
84   hpt neg vpt -1.62 mul V
85   hpt 2 mul 0 V
86   hpt neg vpt 1.62 mul V closepath fill} def
87 /TriD {stroke [] 0 setdash 2 copy vpt 1.12 mul sub M
88   hpt neg vpt 1.62 mul V
89   hpt 2 mul 0 V
90   hpt neg vpt -1.62 mul V closepath stroke
91   Pnt} def
92 /TriDF {stroke [] 0 setdash vpt 1.12 mul sub M
93   hpt neg vpt 1.62 mul V
94   hpt 2 mul 0 V
95   hpt neg vpt -1.62 mul V closepath fill} def
96 /DiaF {stroke [] 0 setdash vpt add M
97   hpt neg vpt neg V hpt vpt neg V
98   hpt vpt V hpt neg vpt V closepath fill} def
99 /Pent {stroke [] 0 setdash 2 copy gsave
100   translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
101   closepath stroke grestore Pnt} def
102 /PentF {stroke [] 0 setdash gsave
103   translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
104   closepath fill grestore} def
105 /Circle {stroke [] 0 setdash 2 copy
106   hpt 0 360 arc stroke Pnt} def
107 /CircleF {stroke [] 0 setdash hpt 0 360 arc fill} def
108 /C0 {BL [] 0 setdash 2 copy moveto vpt 90 450 arc} bind def
109 /C1 {BL [] 0 setdash 2 copy moveto
110         2 copy vpt 0 90 arc closepath fill
111         vpt 0 360 arc closepath} bind def
112 /C2 {BL [] 0 setdash 2 copy moveto
113         2 copy vpt 90 180 arc closepath fill
114         vpt 0 360 arc closepath} bind def
115 /C3 {BL [] 0 setdash 2 copy moveto
116         2 copy vpt 0 180 arc closepath fill
117         vpt 0 360 arc closepath} bind def
118 /C4 {BL [] 0 setdash 2 copy moveto
119         2 copy vpt 180 270 arc closepath fill
120         vpt 0 360 arc closepath} bind def
121 /C5 {BL [] 0 setdash 2 copy moveto
122         2 copy vpt 0 90 arc
123         2 copy moveto
124         2 copy vpt 180 270 arc closepath fill
125         vpt 0 360 arc} bind def
126 /C6 {BL [] 0 setdash 2 copy moveto
127         2 copy vpt 90 270 arc closepath fill
128         vpt 0 360 arc closepath} bind def
129 /C7 {BL [] 0 setdash 2 copy moveto
130         2 copy vpt 0 270 arc closepath fill
131         vpt 0 360 arc closepath} bind def
132 /C8 {BL [] 0 setdash 2 copy moveto
133         2 copy vpt 270 360 arc closepath fill
134         vpt 0 360 arc closepath} bind def
135 /C9 {BL [] 0 setdash 2 copy moveto
136         2 copy vpt 270 450 arc closepath fill
137         vpt 0 360 arc closepath} bind def
138 /C10 {BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill
139         2 copy moveto
140         2 copy vpt 90 180 arc closepath fill
141         vpt 0 360 arc closepath} bind def
142 /C11 {BL [] 0 setdash 2 copy moveto
143         2 copy vpt 0 180 arc closepath fill
144         2 copy moveto
145         2 copy vpt 270 360 arc closepath fill
146         vpt 0 360 arc closepath} bind def
147 /C12 {BL [] 0 setdash 2 copy moveto
148         2 copy vpt 180 360 arc closepath fill
149         vpt 0 360 arc closepath} bind def
150 /C13 {BL [] 0 setdash 2 copy moveto
151         2 copy vpt 0 90 arc closepath fill
152         2 copy moveto
153         2 copy vpt 180 360 arc closepath fill
154         vpt 0 360 arc closepath} bind def
155 /C14 {BL [] 0 setdash 2 copy moveto
156         2 copy vpt 90 360 arc closepath fill
157         vpt 0 360 arc} bind def
158 /C15 {BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill
159         vpt 0 360 arc closepath} bind def
160 /Rec {newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
161         neg 0 rlineto closepath} bind def
162 /Square {dup Rec} bind def
163 /Bsquare {vpt sub exch vpt sub exch vpt2 Square} bind def
164 /S0 {BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare} bind def
165 /S1 {BL [] 0 setdash 2 copy vpt Square fill Bsquare} bind def
166 /S2 {BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
167 /S3 {BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare} bind def
168 /S4 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
169 /S5 {BL [] 0 setdash 2 copy 2 copy vpt Square fill
170         exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
171 /S6 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare} bind def
172 /S7 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill
173         2 copy vpt Square fill Bsquare} bind def
174 /S8 {BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare} bind def
175 /S9 {BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare} bind def
176 /S10 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill
177         Bsquare} bind def
178 /S11 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill
179         Bsquare} bind def
180 /S12 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare} bind def
181 /S13 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
182         2 copy vpt Square fill Bsquare} bind def
183 /S14 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
184         2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
185 /S15 {BL [] 0 setdash 2 copy Bsquare fill Bsquare} bind def
186 /D0 {gsave translate 45 rotate 0 0 S0 stroke grestore} bind def
187 /D1 {gsave translate 45 rotate 0 0 S1 stroke grestore} bind def
188 /D2 {gsave translate 45 rotate 0 0 S2 stroke grestore} bind def
189 /D3 {gsave translate 45 rotate 0 0 S3 stroke grestore} bind def
190 /D4 {gsave translate 45 rotate 0 0 S4 stroke grestore} bind def
191 /D5 {gsave translate 45 rotate 0 0 S5 stroke grestore} bind def
192 /D6 {gsave translate 45 rotate 0 0 S6 stroke grestore} bind def
193 /D7 {gsave translate 45 rotate 0 0 S7 stroke grestore} bind def
194 /D8 {gsave translate 45 rotate 0 0 S8 stroke grestore} bind def
195 /D9 {gsave translate 45 rotate 0 0 S9 stroke grestore} bind def
196 /D10 {gsave translate 45 rotate 0 0 S10 stroke grestore} bind def
197 /D11 {gsave translate 45 rotate 0 0 S11 stroke grestore} bind def
198 /D12 {gsave translate 45 rotate 0 0 S12 stroke grestore} bind def
199 /D13 {gsave translate 45 rotate 0 0 S13 stroke grestore} bind def
200 /D14 {gsave translate 45 rotate 0 0 S14 stroke grestore} bind def
201 /D15 {gsave translate 45 rotate 0 0 S15 stroke grestore} bind def
202 /DiaE {stroke [] 0 setdash vpt add M
203   hpt neg vpt neg V hpt vpt neg V
204   hpt vpt V hpt neg vpt V closepath stroke} def
205 /BoxE {stroke [] 0 setdash exch hpt sub exch vpt add M
206   0 vpt2 neg V hpt2 0 V 0 vpt2 V
207   hpt2 neg 0 V closepath stroke} def
208 /TriUE {stroke [] 0 setdash vpt 1.12 mul add M
209   hpt neg vpt -1.62 mul V
210   hpt 2 mul 0 V
211   hpt neg vpt 1.62 mul V closepath stroke} def
212 /TriDE {stroke [] 0 setdash vpt 1.12 mul sub M
213   hpt neg vpt 1.62 mul V
214   hpt 2 mul 0 V
215   hpt neg vpt -1.62 mul V closepath stroke} def
216 /PentE {stroke [] 0 setdash gsave
217   translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
218   closepath stroke grestore} def
219 /CircE {stroke [] 0 setdash 
220   hpt 0 360 arc stroke} def
221 /Opaque {gsave closepath 1 setgray fill grestore 0 setgray closepath} def
222 /DiaW {stroke [] 0 setdash vpt add M
223   hpt neg vpt neg V hpt vpt neg V
224   hpt vpt V hpt neg vpt V Opaque stroke} def
225 /BoxW {stroke [] 0 setdash exch hpt sub exch vpt add M
226   0 vpt2 neg V hpt2 0 V 0 vpt2 V
227   hpt2 neg 0 V Opaque stroke} def
228 /TriUW {stroke [] 0 setdash vpt 1.12 mul add M
229   hpt neg vpt -1.62 mul V
230   hpt 2 mul 0 V
231   hpt neg vpt 1.62 mul V Opaque stroke} def
232 /TriDW {stroke [] 0 setdash vpt 1.12 mul sub M
233   hpt neg vpt 1.62 mul V
234   hpt 2 mul 0 V
235   hpt neg vpt -1.62 mul V Opaque stroke} def
236 /PentW {stroke [] 0 setdash gsave
237   translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
238   Opaque stroke grestore} def
239 /CircW {stroke [] 0 setdash 
240   hpt 0 360 arc Opaque stroke} def
241 /BoxFill {gsave Rec 1 setgray fill grestore} def
242 /Density {
243   /Fillden exch def
244   currentrgbcolor
245   /ColB exch def /ColG exch def /ColR exch def
246   /ColR ColR Fillden mul Fillden sub 1 add def
247   /ColG ColG Fillden mul Fillden sub 1 add def
248   /ColB ColB Fillden mul Fillden sub 1 add def
249   ColR ColG ColB setrgbcolor} def
250 /BoxColFill {gsave Rec PolyFill} def
251 /PolyFill {gsave Density fill grestore grestore} def
252 /h {rlineto rlineto rlineto gsave closepath fill grestore} bind def
253 %
254 % PostScript Level 1 Pattern Fill routine for rectangles
255 % Usage: x y w h s a XX PatternFill
256 %       x,y = lower left corner of box to be filled
257 %       w,h = width and height of box
258 %         a = angle in degrees between lines and x-axis
259 %        XX = 0/1 for no/yes cross-hatch
260 %
261 /PatternFill {gsave /PFa [ 9 2 roll ] def
262   PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate
263   PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec
264   gsave 1 setgray fill grestore clip
265   currentlinewidth 0.5 mul setlinewidth
266   /PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def
267   0 0 M PFa 5 get rotate PFs -2 div dup translate
268   0 1 PFs PFa 4 get div 1 add floor cvi
269         {PFa 4 get mul 0 M 0 PFs V} for
270   0 PFa 6 get ne {
271         0 1 PFs PFa 4 get div 1 add floor cvi
272         {PFa 4 get mul 0 2 1 roll M PFs 0 V} for
273  } if
274   stroke grestore} def
275 %
276 /languagelevel where
277  {pop languagelevel} {1} ifelse
278  2 lt
279         {/InterpretLevel1 true def}
280         {/InterpretLevel1 Level1 def}
281  ifelse
282 %
283 % PostScript level 2 pattern fill definitions
284 %
285 /Level2PatternFill {
286 /Tile8x8 {/PaintType 2 /PatternType 1 /TilingType 1 /BBox [0 0 8 8] /XStep 8 /YStep 8}
287         bind def
288 /KeepColor {currentrgbcolor [/Pattern /DeviceRGB] setcolorspace} bind def
289 << Tile8x8
290  /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke} 
291 >> matrix makepattern
292 /Pat1 exch def
293 << Tile8x8
294  /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke
295         0 4 M 4 8 L 8 4 L 4 0 L 0 4 L stroke}
296 >> matrix makepattern
297 /Pat2 exch def
298 << Tile8x8
299  /PaintProc {0.5 setlinewidth pop 0 0 M 0 8 L
300         8 8 L 8 0 L 0 0 L fill}
301 >> matrix makepattern
302 /Pat3 exch def
303 << Tile8x8
304  /PaintProc {0.5 setlinewidth pop -4 8 M 8 -4 L
305         0 12 M 12 0 L stroke}
306 >> matrix makepattern
307 /Pat4 exch def
308 << Tile8x8
309  /PaintProc {0.5 setlinewidth pop -4 0 M 8 12 L
310         0 -4 M 12 8 L stroke}
311 >> matrix makepattern
312 /Pat5 exch def
313 << Tile8x8
314  /PaintProc {0.5 setlinewidth pop -2 8 M 4 -4 L
315         0 12 M 8 -4 L 4 12 M 10 0 L stroke}
316 >> matrix makepattern
317 /Pat6 exch def
318 << Tile8x8
319  /PaintProc {0.5 setlinewidth pop -2 0 M 4 12 L
320         0 -4 M 8 12 L 4 -4 M 10 8 L stroke}
321 >> matrix makepattern
322 /Pat7 exch def
323 << Tile8x8
324  /PaintProc {0.5 setlinewidth pop 8 -2 M -4 4 L
325         12 0 M -4 8 L 12 4 M 0 10 L stroke}
326 >> matrix makepattern
327 /Pat8 exch def
328 << Tile8x8
329  /PaintProc {0.5 setlinewidth pop 0 -2 M 12 4 L
330         -4 0 M 12 8 L -4 4 M 8 10 L stroke}
331 >> matrix makepattern
332 /Pat9 exch def
333 /Pattern1 {PatternBgnd KeepColor Pat1 setpattern} bind def
334 /Pattern2 {PatternBgnd KeepColor Pat2 setpattern} bind def
335 /Pattern3 {PatternBgnd KeepColor Pat3 setpattern} bind def
336 /Pattern4 {PatternBgnd KeepColor Landscape {Pat5} {Pat4} ifelse setpattern} bind def
337 /Pattern5 {PatternBgnd KeepColor Landscape {Pat4} {Pat5} ifelse setpattern} bind def
338 /Pattern6 {PatternBgnd KeepColor Landscape {Pat9} {Pat6} ifelse setpattern} bind def
339 /Pattern7 {PatternBgnd KeepColor Landscape {Pat8} {Pat7} ifelse setpattern} bind def
340 } def
341 %
342 %
343 %End of PostScript Level 2 code
344 %
345 /PatternBgnd {
346   TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
347 } def
348 %
349 % Substitute for Level 2 pattern fill codes with
350 % grayscale if Level 2 support is not selected.
351 %
352 /Level1PatternFill {
353 /Pattern1 {0.250 Density} bind def
354 /Pattern2 {0.500 Density} bind def
355 /Pattern3 {0.750 Density} bind def
356 /Pattern4 {0.125 Density} bind def
357 /Pattern5 {0.375 Density} bind def
358 /Pattern6 {0.625 Density} bind def
359 /Pattern7 {0.875 Density} bind def
360 } def
361 %
362 % Now test for support of Level 2 code
363 %
364 Level1 {Level1PatternFill} {Level2PatternFill} ifelse
365 %
366 /Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont
367 dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall
368 currentdict end definefont pop