diff options
author | Karl Berry <karl@freefriends.org> | 2013-10-26 21:42:03 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-10-26 21:42:03 +0000 |
commit | 8fd740a32619f187dd09484ff3ee7efc8c80d044 (patch) | |
tree | 10eae9424c316849a7f29ab872f346ca46f28e35 /Master/texmf-dist/dvips/pst-tools | |
parent | c6b08c07fcd3b89fa78aae8d84283366454b0d9a (diff) |
pst-tools (26oct13)
git-svn-id: svn://tug.org/texlive/trunk@32002 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips/pst-tools')
-rw-r--r-- | Master/texmf-dist/dvips/pst-tools/pst-tools.pro | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/Master/texmf-dist/dvips/pst-tools/pst-tools.pro b/Master/texmf-dist/dvips/pst-tools/pst-tools.pro index 971f66a1f21..c9f7e652e89 100644 --- a/Master/texmf-dist/dvips/pst-tools/pst-tools.pro +++ b/Master/texmf-dist/dvips/pst-tools/pst-tools.pro @@ -1,7 +1,7 @@ -% $Id: pst-tools.pro 713 2012-10-16 14:25:00Z herbert $ +% $Id: pst-tools.pro 842 2013-10-26 10:25:41Z herbert $ % %% PostScript tools prologue for pstricks.tex. -%% Version 0.03, 2012/10/16 +%% Version 0.04, 2013/10/26 %% %% This program can be redistributed and/or modified under the terms %% of the LaTeX Project Public License Distributed from CTAN archives @@ -23,6 +23,15 @@ end } def % +/ps@ReverseOrderOfPoints { % on stack [P1 P2 P3 ...Pn]=>[Pn,Pn-1,...,P2,P1] + 5 dict begin % all local + aload length /n ED % number of coors + n 2 div cvi /m ED % number of Points + /n1 n def + m { n1 2 roll /n1 n1 2 sub def } repeat + n array astore + end +} def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % subroutines for complex numbers, given as an array [a b] % which is a+bi = Real+i Imag @@ -212,20 +221,49 @@ end end } def % -/rightTrim { +/rightTrim { % on stack the string and the character number to be stripped + /charNo exch def dup length 1 sub -1 0 { - /i exch def dup i get 32 ne { exit } if + /i exch def dup i get charNo ne { exit } if } for 0 i 1 add getinterval dup length string copy -} bind def +} bind def % leaves the stripped string on the stack /psStringwidth /stringwidth load def /psShow /show load def -%/stringwidth{ rightTrim psStringwidth } bind def +%/stringwidth{ 32 rightTrim psStringwidth } bind def -%/show { rightTrim psShow } bind def +%/show { 32 rightTrim psShow } bind def +%-----------------------------------------------------------------------------% + +/pgffunctions { + /pgfsc{}bind def% stroke color is empty by default + /pgffc{}bind def% fill color is empty by default + /pgfstr{stroke}bind def% + /pgffill{fill}bind def% + /pgfeofill{eofill}bind def% + /pgfe{a dup 0 rlineto exch 0 exch rlineto neg 0 rlineto closepath}bind def% rectangle + /pgfw{setlinewidth}bind def% setlinewidth + /pgfs{save pgfpd 72 Resolution div 72 VResolution div neg scale + magscale{1 DVImag div dup scale}if + pgfx neg pgfy neg translate pgffoa .setopacityalpha}bind def% save + /pgfr{pgfsd restore}bind def %restore + userdict begin% + /pgfo{pgfsd /pgfx currentpoint /pgfy exch def def @beginspecial}bind def %open + /pgfc{newpath @endspecial pgfpd}bind def %close + /pgfsd{globaldict /pgfdelta /delta where {pop delta} {0} ifelse put}bind def% save delta + /pgfpd{/delta globaldict /pgfdelta get def}bind def % put delta + /.setopacityalpha where {pop} {/.setopacityalpha{pop}def} ifelse % install .setopacityalpha + /.pgfsetfillopacityalpha{/pgffoa exch def + /pgffill{gsave pgffoa .setopacityalpha fill 1 .setopacityalpha newpath fill grestore newpath}bind def + /pgfeofill{gsave pgffoa .setopacityalpha eofill 1 .setopacityalpha newpath eofill grestore newpath}bind def}bind def + /.pgfsetstrokeopacityalpha{/pgfsoa exch def /pgfstr{gsave pgfsoa .setopacityalpha stroke grestore newpath}bind def}bind def + /pgffoa 1 def + /pgfsoa 1 def + end +} def %-----------------------------------------------------------------------------% % END pst-tools.pro |