Debian Codegraph @

texmf-dist/tex/generic/xypic/xyps-pro.tex

raw
1 %% xyps-pro.tex from $Id: xyps-pro.doc,v 3.11 2011/03/14 20:14:00 krisrose Exp $
2 %%
3 %% Xy-pic ``PostScript Prolog'' for PostScript support.
4 %% Copyright (c) 1993-1996 Ross Moore <[email protected]>
5 %%
6 %% This file is part of the Xy-pic package for graphs and diagrams in TeX.
7 %% See the companion README and INSTALL files for further information.
8 %% Copyright (c) 1991-2011 Kristoffer H. Rose <[email protected]>
9 %%
10 %% The Xy-pic package is free software; you can redistribute it and/or modify
11 %% it under the terms of the GNU General Public License as published by the
12 %% Free Software Foundation; either version 2 of the License, or (at your
13 %% option) any later version.
14 %%
15 %% The Xy-pic package is distributed in the hope that it will be useful, but
16 %% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17 %% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 %% for more details.
19 %%
20 %% You should have received a copy of the GNU General Public License along
21 %% with this package; if not, see http://www.gnu.org/licenses/.
22 %%
23 %% As a special exception, you may use this file and all files derived
24 %% from it without restrictions. This special exception was added with
25 %% version 3.7 of Xy-pic.
26 \begingroup \xycatcodes%
27 \count@=\xydashl@\relax \count@@=\xydashw@\relax%
28 \let\firstPS@@=\relax%
29 \xyPSobeylines@@%
30 \PSspecialdict@@{%
31 /XYdict where not{250 dict /XYdict exch def
32 /xy{mark exch XYdict begin countdictstack /xylevel exch def
33 xyopen xycolor mark xypatt xypattern stopped xyclose end
34 cleartomark}def /xyg{gsave xy}def
35 /xyf{currentfont exch xy grestore setfont}def
36 /xycc{{xychgcol}xy}def /xyc{XYdict begin xycolstore end}def
37 /xyx{/xyYpos exch def /xyXpos exch def}def
38 /xyp{currentpoint xyx}def
39 /xyd{setupDirection XYdirection 2 mul}def
40 /xyct{currentpoint xyt 2 copy 6 2 roll}def
41 /xyt{xyXpos xyYpos 2 copy translate}def /xyr{neg rotate xynt}def
42 /xyrs{neg rotate 3 -1 roll sub neg 3 1 roll sub exch moveto xynt}def
43 /xynt{neg exch neg exch translate}def /xys{scale xynt}def
44 /xyss{scale 3 -1 roll sub neg 3 1 roll sub exch moveto xynt}def
45 /xyi{0 0 transform grestore gsave itransform}def
46 }if}%
47 \tmp@false\def\do#1{\DN@{#1}\ifx\next@\nextii@\tmp@true\fi}%
48 \DNii@{17oztex}\xydriversselected@@\iftmp@\PSspecialdict@@{%
49 /@boxy{prespecialVM restore grestore}def
50 /@eoxy{gsave /prespecialVM save def}def
51 }%
52 \else \DNii@{oztex}\xydriversselected@@\iftmp@\PSspecialdict@@{%
53 /@oxy{prespecialVM restore grestore}def
54 /@oxy{gsave /prespecialVM save def}def
55 }\fi\fi%
56 \PSdict@@{/XYdict where pop begin XYdict begin}%
57 \PSdict@@{%
58 /xyopen{currentdict /XYddict known{XYddict null eq{}
59 {XYddict begin xyopen}ifelse}if}def
60 /xyclose{countdictstack -1 xylevel 1 add{pop end}for}def
61 /xychgcol{/xycolor exch def}def /xysetcol{xypush xychgcol}def
62 }%
63 \PSdict@@{%
64 /xypush{16 dict /XYddict exch def XYddict begin}def
65 /undef where
66 {pop /xypop{countdictstack xylevel eq{}{end}ifelse
67 currentdict /XYddict undef}def}
68 {/xypop{countdictstack xylevel eq{}{end}ifelse
69 /XYddict null def}def}ifelse
70 /pu /xypush load def /pp /xypop load def}%
71 \PSdict@@{%
72 /xypspt{72 72.27 div dup scale}bind def /pscorrect{.85 mul}bind def
73 /gstartxy{gsave xypspt xywidth xycap xyjoin xymiter newpath 0 0 moveto}def
74 /xypath{gstartxy rmoveto counttomark 2 idiv -1 1{pop lineto}for}def
75 /xystroke{stroke grestore}bind def
76 /xyfill{closepath fill grestore}bind def
77 /xystfil{closepath gsave fill grestore 0 setgray
78 0 setlinewidth xystroke}bind def
79 /xyeofill{closepath eofill grestore}bind def
80 }%
81 \PSdict@@{%
82 /xypolyline{xypath xystroke}def /xypolyfill{xypath xyfill}def
83 /xydotsep{/@ currentlinewidth 2 mul def}def
84 /xypolydot{xypath xydotsep [xydt @] 0 setdash xystroke}def
85 /xypolydash{xypath xydotsep [@ @] 0 setdash xystroke}def
86 /xypolyeofill{xypath xyeofill}def /pe /xypolyeofill load def
87 /pl /xypolyline load def /pf /xypolyfill load def
88 /pt /xypolydot load def /pd /xypolydash load def }%
89 \PSdict@@{%
90 /arc4pop{arcto 4{pop}repeat}bind def
91 /xyoval{gstartxy oval closepath xystroke}def
92 /xycircle{gstartxy circle xystroke}def
93 /circle{dup 0 moveto 0 0 3 -1 roll 0 360 arc}def
94 /oval{newpath 2 copy exch 5 index add 2 div exch 3 copy 10 3 roll
95 moveto 1 index dup 5 1 roll 3 index 7 index arc4pop
96 dup dup 4 1 roll 4 index exch 6 index arc4pop
97 1 index dup 8 1 roll 4 index 4 index arc4pop
98 arc4pop closepath}def
99 /xyellipse{gstartxy counttomark 1 gt{squarify pop pop 1}if
100 circle xystroke}def
101 /ov /xyoval load def /ox /xyellipse load def }%
102 \PSdict@@{%
103 /dotit{dup currentlinewidth 6 mul div round div
104 /@ exch def [xydt @] 0 setdash}def
105 /elldash{dup 4 -1 roll 10 exch div dashit}def
106 /ovdash{dup 10 dashit}def
107 /dashit{div round 2 mul div /@ exch def [@ @] 0 setdash}def
108 /dotcirc{gstartxy cirlen dotit circle xystroke}def
109 /dashcirc{gstartxy cirlen dashit circle xystroke}def
110 /dotoval{gstartxy 5 copy ovlen dotit oval xystroke}def
111 /dashoval{gstartxy 5 copy ovlen ovdash oval xystroke}def
112 /cirlen{dup 6.283185 mul}bind def
113 /ovlen{3 -1 roll sub 3 1 roll sub add exch 1.716815 mul sub}def
114 /dotellipse{gstartxy counttomark 1 gt{squarify pop pop 1}if
115 cirlen dotit circle closepath xystroke}def
116 /dashellipse{gstartxy counttomark 1 gt{squarify add 2 div 1}
117 {1 exch 1 exch}ifelse cirlen elldash circle xystroke}def
118 /ot /dotellipse load def /od /dashellipse load def
119 /vt /dotoval load def /vd /dashoval load def }%
120 \PSdict@@{%
121 /filloval{gstartxy oval xyfill}def
122 /stfiloval{gstartxy oval xystfil}def
123 /fillcircle{gstartxy circle xyfill}def
124 /stfilcircle{gstartxy circle xystfil}def
125 /fillellipse{gstartxy squarify pop pop 1 circle xyfill}def
126 /stfilellipse{gstartxy squarify pop pop 1 circle xystfil}def
127 /squarify{4 copy sub 2 div 3 1 roll sub 2 div translate
128 add 2 div 3 1 roll add 2 div 2 copy scale
129 2 copy add 2 div currentlinewidth exch div setlinewidth
130 newpath}def
131 /fe /fillellipse load def /sfe /stfilellipse load def
132 /fo /filloval load def /sfo /stfiloval load def
133 /fc /fillcircle load def /sfc /stfilcircle load def }%
134 \PSdict@@{%
135 /xywidth{.4 pscorrect setlinewidth}bind def
136 /xydash{[] 0 setdash}bind def /xycap{1 setlinecap}bind def
137 /xyjoin{1 setlinejoin}bind def /xymiter{10 setmiterlimit}bind def
138 }%
139 \PSdict@@{%
140 /cc{dup exec xychgcol}def
141 /lw{dup setlinewidth /@l exch def
142 /xywidth{@l setlinewidth}bind def}def
143 /lc{dup setlinecap /@c exch def
144 /xycap{@c setlinecap}bind def}def
145 /lj{dup setlinejoin /@j exch def
146 /xyjoin{@j setlinejoin}bind def}def
147 /ml{dup setmitrelimit /@m exch def
148 /xymiter{@m setmitrelimit}bind def}def
149 }%
150 \PSdict@@{%
151 /setupDirection{dup -2048 lt{3072 add neg 1024 exch}
152 {dup 0 lt{1024 add neg -1024}{dup 2048 lt{1024 sub -1024 exch}
153 {3072 sub 1024}ifelse}ifelse}ifelse atan
154 dup 180 gt{360 sub}if dup /XYdirection exch def rotate}def
155 }%
156 \PSdict@@{%
157 userdict begin
158 /gray{setgray}bind def /gray@{setgray}bind def
159 /rgb{setrgbcolor}bind def /rgb@{setrgbcolor}bind def
160 /hsb{sethsbcolor}bind def /hsb@{sethsbcolor}bind def
161 /setcmykcolor where{pop}{/setcmykcolor{dup 3 1 roll dup 5 1 roll
162 exch sub 1 add 5 1 roll exch sub 1 add 4 1 roll
163 exch sub 1 add 3 1 roll setrgbcolor}bind def}ifelse
164 /cmyk{setcmykcolor}bind def /cmyk@{setcmykcolor}bind def
165 /sethalftone where{/sethalftone load /tone exch def}if
166 /xycolarray 3 array def /xycolstore{currentrgbcolor 2 -1 0
167 {exch xycolarray 3 1 roll put}for}def xycolstore
168 /xycolor{0 1 2{xycolarray exch get}for setrgbcolor}def
169 /xypatt{}def /xypattern{cleartomark}bind def
170 end}%
171 \PSdict@@{end end}%
172 \endgroup%
173 \endinput