| 1 |
%% xypspatt.tex from $Id: xypspatt.doc,v 3.11 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% Xy-pic ``PostScript pattern prolog''. |
| 4 |
%% Copyright (c) 1995-1998 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 |
%% |
| 27 |
\begingroup \xycatcodes \xyPSobeylines@@% |
| 28 |
\PSdict@@{/XYdict where pop begin XYdict begin}% |
| 29 |
\PSdict@@{/:patt |
| 30 |
{XYddict begin |
| 31 |
14 dict begin |
| 32 |
/BGnd exch def |
| 33 |
/FGnd exch def |
| 34 |
/PaintData exch def |
| 35 |
/PatternType 1 def |
| 36 |
/PaintType 1 def |
| 37 |
/BBox[0 0 1 1]def |
| 38 |
/TilingType 1 def |
| 39 |
/XStep 1 def |
| 40 |
/YStep 1 def |
| 41 |
/PatternMtx[24 0 0 24 0 0]def |
| 42 |
/PaintProc BGnd null ne |
| 43 |
{{begin BGnd aload pop setrgbcolor 0 0 1 1 rF |
| 44 |
FGnd aload pop setrgbcolor |
| 45 |
24 24 true PatternMtx PaintData imagemask end}} |
| 46 |
{{begin FGnd aload pop setrgbcolor |
| 47 |
24 24 true PatternMtx PaintData imagemask end}} |
| 48 |
ifelse def |
| 49 |
currentdict PatternMtx end |
| 50 |
gsave patangle xyland{180 add}if |
| 51 |
rotate macfreq patfreq div dup neg exch scale matrix currentmatrix |
| 52 |
grestore gsave setmatrix /DeviceRGB setcolorspace makepattern grestore |
| 53 |
end}def}% |
| 54 |
\PSdict@@{% |
| 55 |
/rF{gsave |
| 56 |
newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0 rlineto |
| 57 |
fill grestore}bind def }% |
| 58 |
\PSdict@@{% |
| 59 |
/setpatscreen{/pattstring exch store patfreq |
| 60 |
patangle xyport not{90 add}if |
| 61 |
{1 add 4 mul cvi pattstring exch get exch 1 add 4 mul cvi 7 sub |
| 62 |
bitshift 1 and}setscreen}bind def |
| 63 |
/setcolpattern{setpatscreen 64 div 1 exch sub currentrgbcolor |
| 64 |
1 1 3{pop 1 exch sub 3 index mul 1 exch sub 3 1 roll}for |
| 65 |
setrgbcolor pop}def |
| 66 |
/setgraypattern{setpatscreen 64 div setgray}def |
| 67 |
/macfreq 9.375 def /patangle 0 def /patfreq 12.5 def}% |
| 68 |
\PSdict@@{/checkland{% |
| 69 |
/normland where{pop normland not}{false}ifelse |
| 70 |
/xyland exch def |
| 71 |
/por where{pop por}{/isls where{pop isls not /xyland true def} |
| 72 |
{/land where{pop land not}{true} |
| 73 |
ifelse}ifelse}ifelse /xyport exch def}def }% |
| 74 |
\PSdict@@{% |
| 75 |
/setpatfreq{/patfreq exch def}def |
| 76 |
/setpatangle{/patangle exch def}def |
| 77 |
/setbackcolor{/backcolor exch def}def |
| 78 |
/setforecolor{/forecolor exch def}def |
| 79 |
[1 1 1] setbackcolor xycolarray setforecolor |
| 80 |
/bg /setbackcolor load def /fg /setforecolor load def |
| 81 |
/pa /setpatangle load def /pq /setpatfreq load def }% |
| 82 |
\PSdict@@{% |
| 83 |
/xypattern{checkland counttomark dup 0 eq{pop} |
| 84 |
{dup 1 eq{pop setpatscreen} |
| 85 |
{dup 2 eq{pop setcolpattern} |
| 86 |
{dup 3 eq{pop |
| 87 |
/setcolorspace where { |
| 88 |
/.setcolorspace where{pop pop pop setcolpattern} |
| 89 |
{/.buildpattern where {pop |
| 90 |
forecolor backcolor :patt setpattern |
| 91 |
}{pop pop setcolpattern}ifelse}ifelse} |
| 92 |
{pop setcolpattern}ifelse} |
| 93 |
{5 eq{/setcolorspace where{ |
| 94 |
/.setcolorspace where{pop pop pop pop pop setcolpattern} |
| 95 |
{/.buildpattern where {pop |
| 96 |
:patt setpattern |
| 97 |
}{pop pop pop pop setcolpattern}ifelse}ifelse} |
| 98 |
{pop pop pop setcolpattern}ifelse |
| 99 |
}{}ifelse}ifelse}ifelse}ifelse}ifelse cleartomark }def |
| 100 |
/xysetpattern{/xypatt exch def}def |
| 101 |
/sp /xysetpattern load def }% |
| 102 |
\PSdict@@{end end}% |
| 103 |
\endgroup% |
| 104 |
\endinput |