diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex | 142 |
1 files changed, 69 insertions, 73 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex index a385cf199f5..59ea0915460 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarysvg.path.code.tex @@ -7,10 +7,10 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarysvg.path.code.tex,v 1.7 2013/09/23 18:04:36 tantau Exp $ +\ProvidesFileRCS{pgflibrarysvg.path.code.tex} -\usepgfmodule{parser} +\usepgfmodule{parser}% @@ -25,7 +25,7 @@ % issues a sequences of appropriate \pgfpath commands for this % path. For a description of the compressed svg path syntax, see a % book on svg. -% +% % The notion of a pixel used by svg makes no sense in pgf (actually % it does not really make sense in svg either, but never mind), and % instead of pixels "pt" is used as the basic unit. Use coordinate @@ -34,13 +34,13 @@ % Example: % % \pgfpathsvg{M10 20 L 30-20 0 1} -% +% % % this has the same effect as -% +% % \pgfpathmoveto{\pgfpoint{10pt}{20pt}} % \pgfpathlineto{\pgfpint{30pt}{-20pt}} % \pgfpathlineto{\pgfpint{0pt}{1pt}} -% +% \def\pgfpathsvg#1{% \let\pgf@lib@svg@finish@prev\relax% @@ -52,7 +52,7 @@ \pgf@lib@svg@last@y\pgf@y% \let\pgf@lib@svg@num=\pgfutil@empty% \pgfparserparse{svgpath}#1"% -} +}% @@ -72,12 +72,12 @@ % previous control points. This is done in the following two % variables. If they are empty, there was no previous control point of % the desired kind, in which case the specification prescribes that -% the start point is used. +% the start point is used. -\def\pgf@lib@svg@clear@bezier@quad{ +\def\pgf@lib@svg@clear@bezier@quad{% \let\pgf@lib@svg@bezier@last=\pgfutil@empty \let\pgf@lib@svg@quad@last=\pgfutil@empty -} +}% \pgf@lib@svg@clear@bezier@quad % @@ -90,7 +90,7 @@ { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@moveto} -} +}% \def\pgf@lib@svg@moveto{% \pgf@lib@svg@clear@bezier@quad% @@ -98,7 +98,7 @@ \pgf@lib@svg@last@y=\pgf@lib@svg@get@num{1}pt% \pgfpathmoveto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}% \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto} -} +}% % Handle a relative moveto: @@ -107,7 +107,7 @@ { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@moveto@rel} -} +}% \def\pgf@lib@svg@moveto@rel{% \pgf@lib@svg@clear@bezier@quad% @@ -115,7 +115,7 @@ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{1}pt% \pgfpathmoveto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}% \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto@rel} -} +}% % Handle a lineto: @@ -124,7 +124,7 @@ { \pgf@lib@svg@finish@prev% \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto} -} +}% \def\pgf@lib@svg@lineto{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -135,7 +135,7 @@ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}% \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto}% \fi -} +}% % Handle a relative lineto: @@ -144,7 +144,7 @@ { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto@rel} -} +}% \def\pgf@lib@svg@lineto@rel{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -155,7 +155,7 @@ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}% \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@lineto@rel}% \fi -} +}% % Handle a closepath: @@ -163,12 +163,12 @@ \pgfparserdef{svgpath}{all}{the letter Z} { \pgf@lib@svg@closepath -} +}% \pgfparserdef{svgpath}{all}{the letter z} { \pgf@lib@svg@closepath -} +}% \def\pgf@lib@svg@closepath{ \pgf@lib@svg@finish@prev @@ -176,12 +176,12 @@ \let\pgf@lib@svg@finish@prev=\relax \pgf@lib@svg@clear@bezier@quad% \pgfparserswitch{initial}% -} +}% % Ignore spaces if no other rules says differently: -\pgfparserdef{svgpath}{all}{blank space \space}{} +\pgfparserdef{svgpath}{all}{blank space \space}{}% @@ -192,7 +192,7 @@ { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@hlineto} -} +}% \def\pgf@lib@svg@hlineto{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -202,13 +202,13 @@ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}% \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@hlineto} \fi -} +}% \pgfparserdef{svgpath}{all}{the letter h} { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@hlineto@rel} -} +}% \def\pgf@lib@svg@hlineto@rel{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -218,7 +218,7 @@ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}% \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@hlineto@rel} \fi -} +}% % Handle a horizontal lineto: @@ -227,7 +227,7 @@ { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@vlineto} -} +}% \def\pgf@lib@svg@vlineto{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -237,13 +237,13 @@ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}% \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@vlineto} \fi -} +}% \pgfparserdef{svgpath}{all}{the letter v} { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@vlineto@rel} -} +}% \def\pgf@lib@svg@vlineto@rel{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -253,7 +253,7 @@ \pgfpathlineto{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}% \pgf@lib@svg@read@nums{1}{\pgf@lib@svg@vlineto@rel} \fi -} +}% @@ -264,7 +264,7 @@ { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{6}{\pgf@lib@svg@curveto} -} +}% \def\pgf@lib@svg@curveto{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -283,14 +283,14 @@ % Go on \pgf@lib@svg@read@nums{6}{\pgf@lib@svg@curveto} \fi -} +}% \pgfparserdef{svgpath}{all}{the letter c} { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{6}{\pgf@lib@svg@curveto@rel} -} +}% \def\pgf@lib@svg@curveto@rel{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -308,7 +308,7 @@ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{5}pt% \pgf@lib@svg@read@nums{6}{\pgf@lib@svg@curveto@rel} \fi -} +}% @@ -318,7 +318,7 @@ { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@curveto@smooth} -} +}% \def\pgf@lib@svg@curveto@smooth{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -351,14 +351,14 @@ % Go on \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@curveto@smooth} \fi -} +}% \pgfparserdef{svgpath}{all}{the letter s} { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@curveto@rel@smooth} -} +}% \def\pgf@lib@svg@curveto@rel@smooth{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -383,7 +383,7 @@ {\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{2}pt}{\pgf@lib@svg@get@num{3}pt}}}% % Clear quadratic last point and save new last control point: \let\pgf@lib@svg@quad@last=\pgfutil@empty% - \pgf@process{\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{2}pt}{\pgf@lib@svg@get@num{3}pt}}} + \pgf@process{\pgfpointadd{\pgfqpoint{\pgf@lib@svg@last@x}{\pgf@lib@svg@last@y}}{\pgfqpoint{\pgf@lib@svg@get@num{0}pt}{\pgf@lib@svg@get@num{1}pt}}} \edef\pgf@lib@svg@bezier@last{\noexpand\pgfqpoint{\the\pgf@x}{\the\pgf@y}}% % update \advance\pgf@lib@svg@last@x by\pgf@lib@svg@get@num{2}pt% @@ -391,7 +391,7 @@ % Go on \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@curveto@rel@smooth} \fi -} +}% @@ -402,7 +402,7 @@ { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@quad@curveto} -} +}% \def\pgf@lib@svg@quad@curveto{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -420,14 +420,14 @@ % Go on \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@quad@curveto} \fi -} +}% \pgfparserdef{svgpath}{all}{the letter q} { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@quad@curveto@rel} -} +}% \def\pgf@lib@svg@quad@curveto@rel{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -444,7 +444,7 @@ \advance\pgf@lib@svg@last@y by\pgf@lib@svg@get@num{3}pt% \pgf@lib@svg@read@nums{4}{\pgf@lib@svg@quad@curveto@rel} \fi -} +}% @@ -453,7 +453,7 @@ { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@quad@curveto@smooth} -} +}% \def\pgf@lib@svg@quad@curveto@smooth{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -485,14 +485,14 @@ % Go on \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@quad@curveto@smooth} \fi -} +}% \pgfparserdef{svgpath}{all}{the letter t} { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@quad@curveto@rel@smooth} -} +}% \def\pgf@lib@svg@quad@curveto@rel@smooth{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -524,7 +524,7 @@ % Go on \pgf@lib@svg@read@nums{2}{\pgf@lib@svg@quad@curveto@rel@smooth} \fi -} +}% @@ -534,7 +534,7 @@ { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{7}{\pgf@lib@svg@arcto} -} +}% \def\pgf@lib@svg@arcto{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -553,13 +553,13 @@ % Go on \pgf@lib@svg@read@nums{7}{\pgf@lib@svg@arcto} \fi -} +}% \pgfparserdef{svgpath}{all}{the letter a} { \pgf@lib@svg@finish@prev \pgf@lib@svg@read@nums{7}{\pgf@lib@svg@arcto@rel} -} +}% \def\pgf@lib@svg@arcto@rel{% \ifnum\pgf@lib@svg@count=0\relax% nothing read @@ -578,7 +578,7 @@ % Go on \pgf@lib@svg@read@nums{7}{\pgf@lib@svg@arcto@rel} \fi -} +}% @@ -590,7 +590,7 @@ { \pgf@lib@svg@finish@prev \pgfparserswitch{final} -} +}% @@ -610,26 +610,26 @@ \fi #2 } -} +}% -\def\pgf@lib@svg@get@num#1{\csname pgf@lib@svg@num@#1\endcsname} +\def\pgf@lib@svg@get@num#1{\csname pgf@lib@svg@num@#1\endcsname}% \pgfparserdef{svgpath}{num}{the character ,} { \pgf@lib@svg@handle@spacer -} +}% \pgfparserdef{svgpath}{num}{\meaning\pgfutil@sptoken} { \pgf@lib@svg@handle@spacer -} +}% \pgfparserdef{svgpath}{num}{the character -} { \pgf@lib@svg@handle@spacer \def\pgf@lib@svg@num{-}% -} +}% \def\pgf@lib@svg@handle@spacer{ \ifx\pgf@lib@svg@num\pgfutil@empty% @@ -642,44 +642,40 @@ \fi \let\pgf@lib@svg@num=\pgfutil@empty% \fi -} +}% % Handle digits \pgfparserdef{svgpath}{all}{the character .} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num.}} +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num.}}% \pgfparserdef{svgpath}{all}{the character 0} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num0}} +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num0}}% \pgfparserdef{svgpath}{all}{the character 1} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num1}} +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num1}}% \pgfparserdef{svgpath}{all}{the character 2} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num2}} +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num2}}% \pgfparserdef{svgpath}{all}{the character 3} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num3}} +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num3}}% \pgfparserdef{svgpath}{all}{the character 4} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num4}} +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num4}}% \pgfparserdef{svgpath}{all}{the character 5} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num5}} +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num5}}% \pgfparserdef{svgpath}{all}{the character 6} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num6}} +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num6}}% \pgfparserdef{svgpath}{all}{the character 7} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num7}} +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num7}}% \pgfparserdef{svgpath}{all}{the character 8} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num8}} +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num8}}% \pgfparserdef{svgpath}{all}{the character 9} -{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num9}} - - - - +{\expandafter\def\expandafter\pgf@lib@svg@num\expandafter{\pgf@lib@svg@num9}}% |