diff options
author | Karl Berry <karl@freefriends.org> | 2019-12-19 22:11:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-12-19 22:11:59 +0000 |
commit | 8876a8021514f190d676e4e5261f1084a66754d3 (patch) | |
tree | 9a496107a312a1acbbdb06ea0e1657c285109729 /Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex | |
parent | 693eacf895c01285e2992460bb489142ead8ae8a (diff) |
pgf (19dec19)
git-svn-id: svn://tug.org/texlive/trunk@53187 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex | 179 |
1 files changed, 178 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex index 479992ad373..d04e75ab238 100644 --- a/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/libraries/pgflibrarypatterns.meta.code.tex @@ -85,7 +85,7 @@ \def\pgfdeclarepattern#1{% \begingroup% \nullfont% - \def\pgf@pat@options{#1}% + \def\pgf@pat@options{,#1}% \pgfkeys{/pgf/patterns/.cd,#1}% \ifx\pgf@pat@name\pgfutil@empty \pgferror{Declaring unnamed pattern}% @@ -274,6 +274,183 @@ \pgfsys@setpatternuncolored{#4}{#1}{#2}{#3}% }% +% Predefined patterns + +\pgfdeclarepattern{ + name=Lines, + parameters={ + \pgfkeysvalueof{/pgf/pattern keys/distance}, + \pgfkeysvalueof{/pgf/pattern keys/angle}, + \pgfkeysvalueof{/pgf/pattern keys/xshift}, + \pgfkeysvalueof{/pgf/pattern keys/yshift}, + \pgfkeysvalueof{/pgf/pattern keys/line width}, + }, + bottom left={% + \pgfpoint + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + top right={% + \pgfpoint + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + tile size={% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/distance}}% + {\pgfkeysvalueof{/pgf/pattern keys/distance}}}, + tile transformation={% + \pgftransformrotate{\pgfkeysvalueof{/pgf/pattern keys/angle}}% + \pgftransformshift{% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/xshift}}% + {\pgfkeysvalueof{/pgf/pattern keys/yshift}}}}, + defaults={ + distance/.initial=3pt, + angle/.initial=0, + xshift/.initial=0pt, + yshift/.initial=0pt, + line width/.initial=\the\pgflinewidth, + }, + code={% + \pgfsetlinewidth{\pgfkeysvalueof{/pgf/pattern keys/line width}}% + \pgfpathmoveto{\pgfpoint{-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}{0pt}}% + \pgfpathlineto{\pgfpoint{.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}{0pt}}% + \pgfusepath{stroke}% + }, +} + +\pgfdeclarepattern{ + name=Hatch, + parameters={ + \pgfkeysvalueof{/pgf/pattern keys/distance}, + \pgfkeysvalueof{/pgf/pattern keys/angle}, + \pgfkeysvalueof{/pgf/pattern keys/xshift}, + \pgfkeysvalueof{/pgf/pattern keys/yshift}, + \pgfkeysvalueof{/pgf/pattern keys/line width}, + }, + bottom left={% + \pgfpoint + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + top right={% + \pgfpoint + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + tile size={% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/distance}}% + {\pgfkeysvalueof{/pgf/pattern keys/distance}}}, + tile transformation={% + \pgftransformrotate{\pgfkeysvalueof{/pgf/pattern keys/angle}}% + \pgftransformshift{% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/xshift}}% + {\pgfkeysvalueof{/pgf/pattern keys/yshift}}}}, + defaults={ + distance/.initial=3pt, + angle/.initial=0, + xshift/.initial=0pt, + yshift/.initial=0pt, + line width/.initial=\the\pgflinewidth, + }, + code={% + \pgfsetlinewidth{\pgfkeysvalueof{/pgf/pattern keys/line width}}% + \pgfpathmoveto{\pgfpoint{-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}{0pt}}% + \pgfpathlineto{\pgfpoint{.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}{0pt}}% + \pgfpathmoveto{\pgfpoint{0pt}{-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}% + \pgfpathlineto{\pgfpoint{0pt}{.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}% + \pgfusepath{stroke}% + }, +} + +\pgfdeclarepattern{ + name=Dots, + parameters={ + \pgfkeysvalueof{/pgf/pattern keys/distance}, + \pgfkeysvalueof{/pgf/pattern keys/angle}, + \pgfkeysvalueof{/pgf/pattern keys/xshift}, + \pgfkeysvalueof{/pgf/pattern keys/yshift}, + \pgfkeysvalueof{/pgf/pattern keys/radius}, + }, + bottom left={% + \pgfpoint + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + top right={% + \pgfpoint + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + tile size={% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/distance}}% + {\pgfkeysvalueof{/pgf/pattern keys/distance}}}, + tile transformation={% + \pgftransformrotate{\pgfkeysvalueof{/pgf/pattern keys/angle}}% + \pgftransformshift{% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/xshift}}% + {\pgfkeysvalueof{/pgf/pattern keys/yshift}}}}, + defaults={ + distance/.initial=3pt, + angle/.initial=0, + xshift/.initial=0pt, + yshift/.initial=0pt, + radius/.initial=.5pt, + }, + code={% + \pgfpathcircle% + {\pgfpointorigin}% + {\pgfkeysvalueof{/pgf/pattern keys/radius}} + \pgfusepath{fill}% + }, +} + +\pgfdeclarepattern{ + name=Stars, + parameters={ + \pgfkeysvalueof{/pgf/pattern keys/distance}, + \pgfkeysvalueof{/pgf/pattern keys/angle}, + \pgfkeysvalueof{/pgf/pattern keys/xshift}, + \pgfkeysvalueof{/pgf/pattern keys/yshift}, + \pgfkeysvalueof{/pgf/pattern keys/radius}, + \pgfkeysvalueof{/pgf/pattern keys/points}, + }, + bottom left={% + \pgfpoint + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {-.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + top right={% + \pgfpoint + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}% + {.5*(\pgfkeysvalueof{/pgf/pattern keys/distance})}}, + tile size={% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/distance}}% + {\pgfkeysvalueof{/pgf/pattern keys/distance}}}, + tile transformation={% + \pgftransformrotate{\pgfkeysvalueof{/pgf/pattern keys/angle}}% + \pgftransformshift{% + \pgfpoint + {\pgfkeysvalueof{/pgf/pattern keys/xshift}}% + {\pgfkeysvalueof{/pgf/pattern keys/yshift}}}}, + defaults={ + distance/.initial=3mm, + angle/.initial=0, + xshift/.initial=0pt, + yshift/.initial=0pt, + radius/.initial=1mm, + points/.initial=5, + }, + code={% + \pgfmathsetmacro\a{180/(\pgfkeysvalueof{/pgf/pattern keys/points})}% + \pgfpathmoveto{\pgfpointpolar{90}{\pgfkeysvalueof{/pgf/pattern keys/radius}}}% + \foreach \i in {1,...,\pgfkeysvalueof{/pgf/pattern keys/points}}{% + \pgfpathlineto{\pgfpointpolar{90+2*\i*\a-\a}{.5*(\pgfkeysvalueof{/pgf/pattern keys/radius})}}% + \pgfpathlineto{\pgfpointpolar{90+2*\i*\a}{\pgfkeysvalueof{/pgf/pattern keys/radius}}}% + }% + \pgfpathclose% + \pgfusepath{fill}% + }, +} %%% Local Variables: %%% mode: latex |