diff options
author | Karl Berry <karl@freefriends.org> | 2021-10-01 22:02:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-10-01 22:02:17 +0000 |
commit | 198243b8998916deb875ce76b943080704c49ed7 (patch) | |
tree | ac8d6d4a7cd897936c3b6a91261e8b62cd33a0c0 /Master/texmf-dist/tex | |
parent | 91db8d984edbc2bdf3d6051f4bafe35849dbf3c5 (diff) |
pst-fill (2oct21)
git-svn-id: svn://tug.org/texlive/trunk@60671 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-fill/pst-fill.tex | 264 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/pst-fill/pst-fill.sty | 33 |
2 files changed, 167 insertions, 130 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-fill/pst-fill.tex b/Master/texmf-dist/tex/generic/pst-fill/pst-fill.tex index df7b945f23a..53b23458385 100644 --- a/Master/texmf-dist/tex/generic/pst-fill/pst-fill.tex +++ b/Master/texmf-dist/tex/generic/pst-fill/pst-fill.tex @@ -1,30 +1,9 @@ %% -%% This is file `pst-fill.tex', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% pst-fill.dtx (with options: `pst-fill') -%% -%% IMPORTANT NOTICE: -%% -%% For the copyright see the source file. -%% -%% Any modified versions of this file must be renamed -%% with new filenames distinct from pst-fill.tex. -%% -%% For distribution of the original source see the terms -%% for copying and modification in the file pst-fill.dtx. -%% -%% This generated file may be distributed as long as the -%% original source files, as listed above, are part of the -%% same distribution. (The sources need not necessarily be -%% in the same archive or directory.) -%% -%% Package `pst-fill.dtx' +%% This is Package `pst-fill' %% %% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr> -%% Herbert Voss <voss@pstricks.de> +%% Herbert Voss <hvoss@tug.org> +%% (C) 2003-2021 %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN archives @@ -35,13 +14,13 @@ %% %% \pscircle[linestyle=none,fillstyle=solid,fillcolor=yellow,fillsep=0.5, %% addfillstyle=boxfill](2,2){2} -\def\fileversion{1.01} -\def\filedate{2007/03/10} +\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi +\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey\fi +\def\fileversion{1.02} +\def\filedate{2021/10/01} \message{`PST-Fill' v\fileversion, \filedate\space (tvz,dg,hv)} \csname PSTboxfillLoaded\endcsname \let\PSTboxfillLoaded\endinput -\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi -\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey\fi \edef\PstAtCode{\the\catcode`\@}\catcode`\@=11\relax \pst@addfams{pst-fill} @@ -78,10 +57,8 @@ \psset{boxfillcolor=black}% hv \define@key[psset]{pst-fill}{boxfillangle}{\pst@getangle{#1}\psk@boxfillangle} \psset{boxfillangle=0} -\define@key[psset]{pst-fill}{fillsepx}{% - \pst@getlength{#1}\psk@fillsepx} -\define@key[psset]{pst-fill}{fillsepy}{% - \pst@getlength{#1}\psk@fillsepy} +\define@key[psset]{pst-fill}{fillsepx}{\pst@getlength{#1}\psk@fillsepx} +\define@key[psset]{pst-fill}{fillsepy}{\pst@getlength{#1}\psk@fillsepy} \define@key[psset]{pst-fill}{fillsep}{% \pst@getlength{#1}\psk@fillsepx% \let\psk@fillsepy\psk@fillsepx} @@ -116,9 +93,25 @@ \psset{PstDebug=0} \fi +\def\pstFillSetDefaults{% + \psset{% + boxfillsize={(-15cm,-15cm)(15cm,15cm)}, + boxfillcolor=black, + boxfillangle=0, + fillsep=2pt, + fillsep=0,fillsize=auto, + fillcycle=0, + fillmove=0pt, + fillloopadd=0, + PstDebug=0}% +} + + +\def\txfillDict{ fill@Dict begin } + \newbox\pst@fillbox \def\psboxfill{\pst@killglue\pst@makebox\psboxfill@i} -\def\psboxfill@i{\setbox\pst@fillbox\box\pst@hbox\ignorespaces} +\def\psboxfill@i{\null\setbox\pst@fillbox\box\pst@hbox\ignorespaces}% \null to prevent empty page \def\psfs@boxfill{% \ifvoid\pst@fillbox \@pstrickserr{Fill box is empty. Use \string\psboxfill\space first.}\@ehpa @@ -126,6 +119,7 @@ \ifx\psk@boxfillsize\relax \pst@AutoBoxFill \else\pst@ManualBoxFill\fi \fi} + \def\pst@ManualBoxFill{% \leavevmode \begingroup @@ -135,6 +129,7 @@ \expandafter\pst@AddFillBox\psk@boxfillsize \end@psclip \endgroup} + \def\pst@FlushCode{% \pst@Verb{% /mtrxc CM def @@ -148,6 +143,7 @@ moveto 0 setgray}% \gdef\pst@code{}} + \def\pst@AddFillBox#1 #2 #3 #4 {% \begingroup \setbox\pst@fillbox=\vbox{% @@ -161,18 +157,18 @@ \advance\pst@cntb-\pst@dimb \pst@dimd=\ht\pst@fillbox \divide\pst@cntb\pst@dimd - \def\pst@tempa{% + \def\pst@@tempA{% \pst@tempg \copy\pst@fillbox \advance\pst@cntc\@ne - \ifnum\pst@cntc<\pst@cntd\expandafter\pst@tempa\fi}% + \ifnum\pst@cntc<\pst@cntd\expandafter\pst@@tempA\fi}% \let\pst@tempg\relax \pst@cntc-\tw@ \pst@cntd\pst@cnta \setbox\pst@fillbox=\hbox to \z@{% \kern\pst@dima \kern-\wd\pst@fillbox - \pst@tempa + \pst@@tempA \hss}% \pst@cntd\pst@cntb %% DG modification begin - Dec. 11, 1997 - Patch 2 @@ -185,12 +181,13 @@ \global\setbox\pst@boxg=\vbox to\z@{% \offinterlineskip \vss - \pst@tempa + \pst@@tempA \vskip\pst@dimb}% \endgroup \setbox\pst@fillbox\box\pst@boxg \pst@rotate\psk@boxfillangle\pst@fillbox \box\pst@fillbox} + \def\pst@ManualFillCycle{% \ifx\PstTiling\@undefined \pst@cntg=\psk@fillcycle @@ -208,18 +205,20 @@ \def\pst@tempg{% \ifnum\pst@cnth<\pst@cntg\advance\pst@cnth\@ne\else\pst@cnth\z@\fi \moveright\pst@cnth\pst@dimg}} -%% Auto box fill: !! Fix dictionary -%% DG addition begin - Apr. 8, 1997 and Dec. 1997 - Patch 2 -\ifx\PstTiling\@undefined -\pst@def{AutoFillCycle}<% - /c ED - /n 0 def - /s { - /x x w c div n mul add def - /n n c abs 1 sub lt { n 1 add } { 0 } ifelse def - } def> +\ifx\PstTiling\@undefined + \pst@def{AutoFillCycle}<% + fill@Dict begin + /c ED + /n 0 def + /s { + /x x w c div n mul add def + /n n c abs 1 sub lt { n 1 add } { 0 } ifelse def + } def + end + > \pst@def{BoxFill}<% + fill@Dict begin gsave gsave \tx@STV CM grestore dtransform CM idtransform abs /h ED abs /w ED @@ -239,50 +238,64 @@ s x2 { save CP x y1 -%% patch 4 hv -------------- \ifx\VTeXversion\undefined \else -%%============ mv: 09-10-01 ??? this is likely to be a right change neg -%%============ \fi -%% end patch 4 -T moveto Box restore + T moveto Box restore /x x w add def } repeat /y1 y1 h add def } repeat % Next line not useful... To see that, suppress clipping (DG) CP x y1 T moveto Box - currentpoint currentfont grestore setfont moveto> -\else -%% DG modification begin - Apr. 8, 1997 and Nov. / Dec. 1997 - Patch 2 -\pst@def{AutoFillCycleX}<% - /cX ED - /nX 0 def - /CycleX { - /x x w cX div nX mul add def - /nX nX cX abs 1 sub lt { nX 1 add } { 0 } ifelse def - } def> -\pst@def{AutoFillCycleY}<% - /cY ED - /mY 0 def - /nY 0 def - /CycleY { - /y1 y1 h cY div mY mul sub def - nY cY abs 1 sub lt { /nY nY 1 add def /mY 1 def } + end + currentpoint currentfont grestore setfont moveto + > +\else% Tiling is defined ----------------------------------- + \pst@def{AutoFillCycleX}< +% fill@Dict begin + /cX ED + /nX 0 def + /CycleX { + /x x w cX div nX mul add def + /nX nX cX abs 1 sub lt { nX 1 add } { 0 } ifelse def + } def +% end + > + \pst@def{AutoFillCycleY}<% +% fill@Dict begin + /cY ED + /mY 0 def + /nY 0 def + /CycleY { + /y1 y1 h cY div mY mul sub def + nY cY abs 1 sub lt { /nY nY 1 add def /mY 1 def } { /nY 0 def /mY cY abs 1 sub neg def } ifelse - } def> - -\pst@def{BoxFill}<% - gsave + } def +% end + > + \pst@def{BoxFill}< + \ifPSTlualatex + /save /gsave load def + /restore /grestore load def + fill@Dict begin + \fi + gsave gsave \tx@STV CM grestore dtransform CM idtransform abs /h ED abs /w ED - pathbbox + pathbbox + \ifPSTlualatex + h div 2 add cvi /y2 ED + w div 2 add cvi /x2 ED + h div 2 sub cvi /y1 ED + w div 2 sub cvi /x1 ED + \else h div round 2 add cvi /y2 ED w div round 2 add cvi /x2 ED h div round 2 sub cvi /y1 ED w div round 2 sub cvi /x1 ED + \fi /CoefLoopX 0 def /CoefLoopY 0 def /CoefMoveX 0 def @@ -304,22 +317,19 @@ T moveto Box restore /CoefLoopY CoefLoopY \psk@fillloopaddy\space add def /x2 x2 x1 sub 4 sub CoefLoopX 2 mul add def /y2 y2 y1 sub 4 sub CoefLoopY 2 mul add def -%% We must fix the origin of tiling, as it must not vary according other stuff -%% in the page! + %% We must fix the origin of tiling, as it must not vary according other stuff in the page! w x1 CoefLoopX add CoefMoveX add mul h y1 y2 add 1 sub CoefLoopY sub CoefMoveY sub mul moveto - CP + CP y1 h mul sub neg /y1 ED x1 w mul sub neg /x1 ED -%% hv 2004-06-22 to prevent clash with pst-gr3d -%% \psk@PstDebug 0 eq {clip} if \Pst@Debug 0 eq {clip} if -%% end hv \psk@fillmovex\space \psk@fillmovey - gsave \tx@STV CM grestore dtransform CM idtransform + gsave \tx@STV CM grestore + dtransform CM idtransform /hmove ED /wmove ED /row 0 def - y2 { + y2 { /row row 1 add def /column 0 def /x x1 def @@ -328,40 +338,90 @@ T moveto Box restore x2 { /column column 1 add def CycleY - save CP x y1 -%% patch 4 hv -------------- - \ifx\VTeXversion\undefined - \else -%%============ mv: 09-10-01 ??? this is likely to be a right change - neg -%%============ - \fi - T moveto Box restore + save CP x y1 + \ifPSTlualatex neg \fi + T moveto Box restore /x x w add def 0 hmove translate } repeat restore /y1 y1 h add def wmove 0 translate - } repeat - currentpoint currentfont grestore setfont moveto> -\fi + } repeat + currentpoint + currentfont + grestore + setfont + moveto + \ifPSTlualatex end \fi + > +\fi % edn of tiling=true -\def\pst@AutoBoxFill{% - \leavevmode - \begingroup +\ifPSTlualatex + \def\pst@AutoBoxFill{% + \leavevmode + \begingroup + \pst@stroke + \pst@FlushCode + \pst@Verb{\psk@boxfillangle\space \tx@RotBegin}% + \pstVerb{ + \pst@dict /Box [ /gsave cvx currentpoint /translate cvx \luaPSTbox\hbox{% + \ifx\PstTiling\@undefined + \else + \ifx\pst@tempa\@undefined % Undefined for instance for \pscharpath + \else\ifx\pst@tempa\@empty\else + \def\pst@temph{0}% + \ifx\pst@tempa\pst@temph + \else + \fi + \fi\fi + \fi + \hbox to \z@{\vbox to\z@{\vss\copy\pst@fillbox\vskip-\dp\pst@fillbox}\hss}% + } /.TeXBox findresource /grestore cvx ] cvx def + \ifx\PstTiling\@undefined + \ifnum\psk@fillcycle=\z@ + /s {} def + \else + \psk@fillcycle \tx@AutoFillCycle + \fi + \else + \ifnum\psk@fillcyclex=\z@ + /CycleX {} def + \else + \psk@fillcyclex\space \tx@AutoFillCycleX + \fi + \ifnum\psk@fillcycley=\z@ + /CycleY {} def + \else + \psk@fillcycley\space \tx@AutoFillCycleY + \fi + \fi + \pst@number{\wd\pst@fillbox}% + \psk@fillsepx\space add + \pst@number{\ht\pst@fillbox}% + \pst@number{\dp\pst@fillbox}% + \psk@fillsepy\space add add + \tx@BoxFill + end + }% + \pst@Verb{\tx@RotEnd}% + \endgroup} +\else%%%%%%%%%%%%%%% latex->dvips definition + \def\pst@AutoBoxFill{% + \leavevmode + \begingroup \pst@stroke \pst@FlushCode \pst@Verb{\psk@boxfillangle\space \tx@RotBegin}% \pstVerb{\pst@dict /Box \pslbrace end}% \ifx\PstTiling\@undefined \else - \ifx\pst@tempa\@undefined % Undefined for instance for \pscharpath - \else\ifx\pst@tempa\@empty\else + \ifx\pst@@tempA\@undefined % Undefined for instance for \pscharpath + \else\ifx\pst@@tempA\@empty\else \def\pst@temph{0}% - \ifx\pst@tempa\pst@temph + \ifx\pst@@tempA\pst@temph \else - \pstVerb{/TR {pop pop currentpoint translate \pst@tempa\space translate } def}% + \pstVerb{/TR {pop pop currentpoint translate \pst@@tempA\space translate } def}% \fi \fi\fi \fi @@ -404,6 +464,8 @@ T moveto Box restore \fi \pst@Verb{\tx@RotEnd}% \endgroup} +\fi +% \catcode`\@=\PstAtCode\relax \endinput %% diff --git a/Master/texmf-dist/tex/latex/pst-fill/pst-fill.sty b/Master/texmf-dist/tex/latex/pst-fill/pst-fill.sty index a183650f4f5..d5a2eb9736c 100644 --- a/Master/texmf-dist/tex/latex/pst-fill/pst-fill.sty +++ b/Master/texmf-dist/tex/latex/pst-fill/pst-fill.sty @@ -1,30 +1,9 @@ %% %% This is file `pst-fill.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% pst-fill.dtx (with options: `latex-wrapper') -%% -%% IMPORTANT NOTICE: -%% -%% For the copyright see the source file. -%% -%% Any modified versions of this file must be renamed -%% with new filenames distinct from pst-fill.sty. -%% -%% For distribution of the original source see the terms -%% for copying and modification in the file pst-fill.dtx. -%% -%% This generated file may be distributed as long as the -%% original source files, as listed above, are part of the -%% same distribution. (The sources need not necessarily be -%% in the same archive or directory.) -%% -%% Package `pst-fill.dtx' %% %% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr> -%% Herbert Voss <voss@pstricks.de> +%% Herbert Voss <hvoss@tug.org> +%% (C) 2007-2021 %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN archives @@ -33,16 +12,12 @@ %% DESCRIPTION: %% `pst-fill' is a PSTricks package for filling and tiling areas %% -%% \pscircle[linestyle=none,fillstyle=solid,fillcolor=yellow,fillsep=0.5, -%% addfillstyle=boxfill](2,2){2} \RequirePackage{pstricks} -\ProvidesPackage{pst-fill}[2005/09/13 package wrapper for - pst-fill.tex (hv)] +\ProvidesPackage{pst-fill}[2010/03/20 package wrapper for pst-fill.tex (hv)] \DeclareOption{tiling}{\def\PstTiling{true}} \ProcessOptions\relax \input{pst-fill.tex} -\ProvidesFile{pst-fill.tex} - [\filedate\space v\fileversion\space `PST-fill' (tvz,dg)] +\ProvidesFile{pst-fill.tex} [\filedate\space v\fileversion\space `PST-fill' (tvz,dg,hv)] \endinput %% %% End of file `pst-fill.sty'. |