1 %% xypdf-f.tex from $Id: xypdf-f.doc,v $ |
|
2 %% |
|
3 %% Xy-pic ``Frame extension'' PDF backend support. |
|
4 %% Copyright (c) 1999-1999 Ross Moore <ross@mpce.mq.edu.au> |
|
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-1999 Kristoffer H. Rose <krisrose@brics.dk> |
|
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, write to the Free Software Foundation, Inc., |
|
22 %% 675 Mass Ave, Cambridge, MA 02139, USA. |
|
23 %% |
|
24 %% As a special exception, you may use this file and all files derived |
|
25 %% from it without restrictions. This special exception was added with |
|
26 %% version 3.7 of Xy-pic. |
|
27 %% |
|
28 \expandafter\ifx\csname xypdf-floaded\endcsname\empty |
|
29 \message{not reloaded}\endinput \fi |
|
30 \expandafter\let\csname xypdf-floaded\endcsname=\empty \xycatcodes |
|
31 \xydef@\installPDFframes@{% |
|
32 \let\framed@body@@=\xyPDFframed@body@ |
|
33 \let\circled@x@@=\xyPDFcircled@x@ |
|
34 \let\ellipsed@x@@=\xyPDFellipsed@x@ |
|
35 \installPDFfills@ |
|
36 \xyuncatcodes} |
|
37 \xydef@\UsePDFframes{\installPDFframes@} |
|
38 \xydef@\NoPDFframes{\UnloadFrames@} |
|
39 \xydef@\xyPDFframed@body@{\DN@{\framed@body@}% |
|
40 \ifx\framehfill\frm@solidh@@ |
|
41 \DN@{\xyPDFframed@oval@\xyPDFoval@Special}% |
|
42 \else\ifdim\R@=\z@\else |
|
43 \ifx\framehfill\frm@dashh@@ |
|
44 \DN@{\xyPDFframed@oval@\xyPDFdashoval@Special}% |
|
45 \else\ifx\framehfill\frm@doth@@ |
|
46 \DN@{\xyPDFframed@oval@\xyPDFdotoval@Special}% |
|
47 \fi\fi |
|
48 \fi\fi \next@ } |
|
49 \xydef@\xyPDFframed@oval@#1{\vglue\U@c |
|
50 \hbox{\hglue\L@c\xypdfoval@#1\hglue\R@c}\vglue\D@c} |
|
51 \xydef@\xyPDFcircled@x@{\DN@{\xyPDFcircled@x@@\xyPDFcirc@Special}% |
|
52 \ifx\framehfill\frm@doth@@ |
|
53 \DN@{\xyPDFcircled@x@@\xyPDFdotcirc@Special}% |
|
54 \else\ifx\framehfill\frm@dashh@@ |
|
55 \DN@{\xyPDFcircled@x@@\xyPDFdashcirc@Special}% |
|
56 \fi\fi \next@ } |
|
57 \xydef@\xyPDFcircled@x@@#1{\vglue2\R@ |
|
58 \hbox{\hglue2\R@\xypdfcircle@#1\hglue2\R@}% |
|
59 \vglue2\R@} |
|
60 \xydef@\xyPDFellipsed@x@#1#2{% |
|
61 \DN@{\xyPDFellipsed@x@@\xyPDFcirc@Special}% |
|
62 \ifx\framehfill\frm@doth@@ |
|
63 \DN@{\xyPDFellipsed@x@@\xyPDFdotcirc@Special}% |
|
64 \else\ifx\framehfill\frm@dashh@@ |
|
65 \DN@{\xyPDFellipsed@x@@\xyPDFdashcirc@Special}% |
|
66 \fi\fi \next@{#1}{#2}} |
|
67 \xydef@\xyPDFellipsed@x@@#1#2#3{\vglue #3\vglue #3\relax |
|
68 \hbox{\L@c = #2\relax \R@c=\L@c \D@c = #3\relax \U@c=\D@c |
|
69 \hglue#2\hglue#2\relax\xypdfellipse@#1\hglue#2\hglue#2\relax}% |
|
70 \vglue #3\vglue #3\relax} |
|
71 \xydef@\xyPDFdashhfill@{{\SemiDirectionChar=95 \Direction=3072 \xyPDFdash@}} |
|
72 \xydef@\xyPDFdashvfill@{{\SemiDirection=31 \Direction=1023 \xyPDFdash@}} |
|
73 \xydef@\xypdfoval@#1{% |
|
74 \dimen@=\L@c \advance\dimen@\R@c |
|
75 \dimen@ii=\U@c \advance\dimen@ii\D@c |
|
76 \ifdim\dimen@ii<\dimen@ \relax \dimen@=\dimen@ii\fi \divide\dimen@\tw@ |
|
77 \ifdim\R@>\dimen@ \relax \R@=\dimen@ \fi |
|
78 \D@c=-\D@c \L@c=-\L@c |
|
79 \edef\tmp@{\expandafter\removePT@\the\R@ |
|
80 \space\expandafter\removePT@\the\R@c |
|
81 \space\expandafter\removePT@\the\D@c |
|
82 \space\expandafter\removePT@\the\L@c |
|
83 \space\expandafter\removePT@\the\U@c }% |
|
84 \expandafter#1\expandafter{\tmp@}} |
|
85 \xydef@\xypdfcircle@#1{\dimen@=\R@ |
|
86 \edef\tmp@{\expandafter\removePT@\the\dimen@}% |
|
87 \expandafter#1\expandafter{\tmp@}} |
|
88 \xydef@\xypdfellipse@#1{\edef\tmp@{% |
|
89 \expandafter\removePT@\the\U@c \space |
|
90 \expandafter\removePT@\the\D@c \space |
|
91 \expandafter\removePT@\the\L@c \space |
|
92 \expandafter\removePT@\the\R@c }% |
|
93 \expandafter#1\expandafter{\tmp@}} |
|
94 \xydef@\xyPDFoval@Special#1{\PDFmacro@{#1 ov}}%%%%<<<---- here |
|
95 \xydef@\xyPDFcirc@Special#1{\PDFmacro@{#1 ox}}%%%%<<<---- here |
|
96 \xydef@\xyPDFdotcirc@Special#1{\PDFmacro@{#1 ot}}%%%%<<<---- here |
|
97 \xydef@\xyPDFdashcirc@Special#1{\PDFmacro@{#1 od}}%%%%<<<---- here |
|
98 \xydef@\xyPDFdotoval@Special#1{\PDFmacro@{#1 vt}}%%%%<<<---- here |
|
99 \xydef@\xyPDFdashoval@Special#1{\PDFmacro@{#1 vd}}%%%%<<<---- here |
|
100 \xydef@\xyPDFfilledRegion#1#2{\setboxz@h{\lower\D@c\vbox{% |
|
101 \vglue\U@c\hbox{#1#2\empty\hglue\L@c\hglue\R@c}\vglue\D@c}}% |
|
102 \ht\z@=\z@ \dp\z@=\z@ \wd\z@=\z@ \boxz@} |
|
103 \xydef@\filledRectangle@PDF{% |
|
104 \xyPDFfilledRegion{\xypdfoval@\xyPDFfilloval@Special}} |
|
105 \xydef@\filledCircle@PDF#1{{\R@c=\R@ \L@c=\R@ \U@c=\R@ \D@c=\R@ |
|
106 \xyPDFfilledRegion{\xypdfcircle@\xyPDFfillcirc@Special}#1}} |
|
107 \xydef@\filledEllipse@PDF{% |
|
108 \xyPDFfilledRegion{\xypdfellipse@\xyPDFfillellipse@Special}} |
|
109 \xydef@\filledOval@PDF{% |
|
110 \xyPDFfilledRegion{\xypdfoval@\xyPDFfilloval@Special}} |
|
111 \xydef@\frame@emph@PDF#1{\filled@{#1}\relax} |
|
112 \xydef@\installPDFfills@{% |
|
113 \let\frame@emph@@=\frame@emph@PDF |
|
114 \let\filledRectangle@@=\filledRectangle@PDF |
|
115 \let\filledOval@@=\filledOval@PDF |
|
116 \let\filledCircle@@=\filledCircle@PDF |
|
117 \let\filledEllipse@@=\filledEllipse@PDF |
|
118 } |
|
119 \xydef@\xyPDFfilloval@Special#1#2{% |
|
120 \ifx#2\relax\PDFmacro@{#1 sfo}%%%%%<<<---- here |
|
121 \else\PDFmacro@{#1 fo}\fi}%%%%<<<---- here |
|
122 \xydef@\xyPDFfillcirc@Special#1#2{% |
|
123 \ifx#2\relax\PDFmacro@{#1 sfc}%%%%%<<<---- here |
|
124 \else\PDFmacro@{#1 fc}\fi}%%%%<<<---- here |
|
125 \xydef@\xyPDFfillellipse@Special#1#2{% |
|
126 \ifx#2\relax\PDFmacro@{#1 sfe}%%%%%<<<---- here |
|
127 \else\PDFmacro@{#1 fe}\fi}%%%%<<<---- here |
|
128 \endinput |
|