diff options
author | Karl Berry <karl@freefriends.org> | 2010-02-11 23:48:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-02-11 23:48:39 +0000 |
commit | a82c24b304d3a6727a9cd210d82b33b2c9e3119b (patch) | |
tree | 2f331ad49c6edf41f80a30eda60945397bb38428 /Master/texmf-dist/dvips/pstricks | |
parent | b164898a09f10287c030149a0a36c7938627a9c3 (diff) |
pstricks 0.41 (11feb10)
git-svn-id: svn://tug.org/texlive/trunk@16973 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips/pstricks')
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pst-algparser.pro | 6 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pst-dots.pro | 12 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pst-node.pro | 433 | ||||
-rw-r--r-- | Master/texmf-dist/dvips/pstricks/pstricks.pro | 317 |
4 files changed, 265 insertions, 503 deletions
diff --git a/Master/texmf-dist/dvips/pstricks/pst-algparser.pro b/Master/texmf-dist/dvips/pstricks/pst-algparser.pro index ab96e87353e..d2150d6b074 100644 --- a/Master/texmf-dist/dvips/pstricks/pst-algparser.pro +++ b/Master/texmf-dist/dvips/pstricks/pst-algparser.pro @@ -1,4 +1,4 @@ -% $Id: pst-algparser.pro 26 2008-06-14 11:50:02Z herbert $ +% $Id: pst-algparser.pro 90 2009-01-30 10:58:51Z herbert $ %% %% PostScript prologue for PSTricks algorithm parser %% Version 0.01, 2008/01/01 @@ -739,5 +739,5 @@ end%%%tx@CoreAnalyzerDict /Fact { 1 exch 2 exch 1 exch { mul } for } bind def /fact { Fact } bind def end - -% END pstricks.pro +% +% END pst-algparser.pro
\ No newline at end of file diff --git a/Master/texmf-dist/dvips/pstricks/pst-dots.pro b/Master/texmf-dist/dvips/pstricks/pst-dots.pro index 8077b3d59a0..915c20cf363 100644 --- a/Master/texmf-dist/dvips/pstricks/pst-dots.pro +++ b/Master/texmf-dist/dvips/pstricks/pst-dots.pro @@ -1,7 +1,7 @@ -% $Id: pst-dots.pro 26 2008-06-14 11:50:02Z herbert $ +% $Id: pst-dots.pro 130 2009-08-27 08:55:03Z herbert $ % %% PostScript prologue for pstricks.tex. -%% Version 2.02, 2008/04/18 +%% Version 2.02, 2009/06/16 %% %% For distribution, see pstricks.tex. %% @@ -19,8 +19,8 @@ 10 dict dup begin % hold local /FontType 3 def /FontMatrix [.001 0 0 .001 0 0] def - /FontBBox [-571.5 -742.5 571.5 742.5] def -% /FontBBox [-1000 -1000 1000 1000] def % See end of file in /BuildGlyph +% /FontBBox [-571.5 -742.5 571.5 742.5] def % changed to next line 20060616 hv + /FontBBox [-1000 -1000 1000 1000] def % See end of file in /BuildGlyph /Encoding 256 array def 0 1 255 {Encoding exch /.notdef put} for % fill the array with /.notdef Encoding % replace with given dot names @@ -166,8 +166,8 @@ end 1 index /Encoding get exch get 1 index /BuildGlyph get exec } bind def - +% end /PSTricksDotFont exch definefont pop - +% %% end
\ No newline at end of file diff --git a/Master/texmf-dist/dvips/pstricks/pst-node.pro b/Master/texmf-dist/dvips/pstricks/pst-node.pro deleted file mode 100644 index 72e43440fd9..00000000000 --- a/Master/texmf-dist/dvips/pstricks/pst-node.pro +++ /dev/null @@ -1,433 +0,0 @@ -% $Id: pst-node.pro 90 2009-01-30 10:58:51Z herbert $ -%% -%% PostScript prologue for pst-node.tex. -%% Version 1.02, 2009/01/30. -%% -%% This program can be redistributed and/or modified under the terms -%% of the LaTeX Project Public License Distributed from CTAN archives -%% in directory macros/latex/base/lppl.txt. -% -/tx@NodeDict 400 dict def tx@NodeDict begin -tx@Dict begin % from main pstricks dict - /T /translate load def -end -/NewNode { % on stack: { x y } boolean N@name type InitXnode - gsave - /next ED % { x y } boolean N@name type - dict dup % { x y } boolean N@name dict dict - 3 1 roll def % { x y } boolean dict N@name dict def - exch { dup 3 1 roll def } if % { x y } dict boolean - begin % { x y } dict begin - tx@Dict begin - STV CP T exec % set scaling - end - /NodeMtrx CM def % save CM - next % InitXNode - end - grestore -} def -% -/InitPnode { - /Y ED /X ED - /NodePos { NodeSep Cos mul NodeSep Sin mul } def -} def -% -/InitCnode { - /r ED /Y ED /X ED - /NodePos { NodeSep r add dup Cos mul exch Sin mul } def -} def -% -/GetRnodePos { - Cos 0 gt { /dx r NodeSep add def } { /dx l NodeSep sub def } ifelse - Sin 0 gt { /dy u NodeSep add def } { /dy d NodeSep sub def } ifelse - dx Sin mul abs dy - Cos mul abs gt { dy Cos mul Sin div dy } { dx dup Sin mul Cos Div } ifelse -} def -% -/InitRnode { - /Y ED /X ED X sub /r ED /l X neg def Y add neg /d ED Y sub /u ED - /NodePos { GetRnodePos } def -} def -% -/DiaNodePos { - w h mul w Sin mul abs h Cos mul abs add Div NodeSep add dup - Cos mul exch Sin mul -} def -% -/TriNodePos { - Sin s lt - { d NodeSep sub dup Cos mul Sin Div exch } - { w h mul w Sin mul h Cos abs mul add Div - NodeSep add dup Cos mul exch Sin mul - } ifelse -} def -% -/InitTriNode { - sub 2 div exch - 2 div exch - 2 copy T - 2 copy 4 index index /d ED - pop pop pop pop - -90 mul rotate - /NodeMtrx CM def - /X 0 def /Y 0 def - d sub abs neg /d ED - d add /h ED - 2 div h mul h d sub Div /w ED - /s d w Atan sin def - /NodePos { TriNodePos } def -} def -% -/OvalNodePos { - /ww w NodeSep add def - /hh h NodeSep add def - Sin ww mul Cos hh mul Atan dup cos ww mul exch sin hh mul -} def -% -/GetCenter { begin X Y NodeMtrx transform CM itransform end } def -% -/XYPos { - dup sin exch cos Do - /Cos ED /Sin ED /Dist ED - Cos 0 gt - { Dist Dist Sin mul Cos div } - { Cos 0 lt - { Dist neg Dist Sin mul Cos div neg } - { 0 Dist Sin mul } ifelse - } ifelse - Do -} def -% -/GetEdge { - dup 0 eq - { pop begin 1 0 NodeMtrx dtransform - CM idtransform - exch atan sub - dup - sin /Sin ED - cos /Cos ED - /NodeSep ED - NodePos NodeMtrx dtransform CM idtransform end } - { 1 eq {{exch}} {{}} ifelse /Do ED pop XYPos } ifelse -} def -% -/AddOffset { - 1 index 0 eq - { pop pop } - { 2 copy 5 2 roll cos mul add 4 1 roll sin mul sub exch } ifelse -} def -% -/GetEdgeA { - NodeSepA AngleA NodeA NodeSepTypeA GetEdge - OffsetA AngleA AddOffset - yA add /yA1 ED - xA add /xA1 ED -} def -% -/GetEdgeB { - NodeSepB AngleB NodeB NodeSepTypeB GetEdge - OffsetB AngleB AddOffset - yB add /yB1 ED - xB add /xB1 ED -} def -% -/GetArmA { - ArmTypeA 0 eq - { /xA2 ArmA AngleA cos mul xA1 add def - /yA2 ArmA AngleA sin mul yA1 add def } - { ArmTypeA 1 eq {{exch}} {{}} ifelse - /Do ED - ArmA AngleA XYPos OffsetA AngleA AddOffset - yA add /yA2 ED - xA add /xA2 ED } ifelse -} def -% -/GetArmB { - ArmTypeB 0 eq - { /xB2 ArmB AngleB cos mul xB1 add def - /yB2 ArmB AngleB sin mul yB1 add def } - { ArmTypeB 1 eq {{exch}} {{}} ifelse - /Do ED - ArmB AngleB XYPos OffsetB AngleB AddOffset - yB add /yB2 ED - xB add /xB2 ED } ifelse -} def -% -/InitNC { - /b ED /a ED % second and first node - /NodeSepTypeB ED /NodeSepTypeA ED - /NodeSepB ED /NodeSepA ED - /OffsetB ED /OffsetA ED - tx@NodeDict a known tx@NodeDict b known and dup { - /NodeA a load def - /NodeB b load def - NodeA GetCenter /yA ED /xA ED - NodeB GetCenter /yB ED /xB ED } if -} def -% -/LPutLine { - 4 copy - 3 -1 roll sub neg 3 1 roll sub Atan /NAngle ED - 1 t sub mul - 3 1 roll 1 t sub mul - 4 1 roll t mul add /Y ED - t mul add /X ED -} def -% -/LPutLines { - mark LPutVar counttomark 2 div 1 sub /n ED -% t floor dup n gt - t floor dup n ge % to allow npos<= hv 2008-08-14 - { pop n 1 sub /t 1 def } { dup t sub neg /t ED } ifelse - cvi 2 mul { pop } repeat - LPutLine - cleartomark -} def -% -/BezierMidpoint { /y3 ED /x3 ED /y2 ED /x2 ED /y1 ED /x1 ED /y0 ED /x0 ED -/t ED /cx x1 x0 sub 3 mul def /cy y1 y0 sub 3 mul def /bx x2 x1 sub 3 -mul cx sub def /by y2 y1 sub 3 mul cy sub def /ax x3 x0 sub cx sub bx -sub def /ay y3 y0 sub cy sub by sub def ax t 3 exp mul bx t t mul mul -add cx t mul add x0 add ay t 3 exp mul by t t mul mul add cy t mul add -y0 add 3 ay t t mul mul mul 2 by t mul mul add cy add 3 ax t t mul mul -mul 2 bx t mul mul add cx add atan /NAngle ED /Y ED /X ED } def -/HPosBegin { yB yA ge { /t 1 t sub def } if /Y yB yA sub t mul yA add def -} def -/HPosEnd { /X Y yyA sub yyB yyA sub Div xxB xxA sub mul xxA add def -/NAngle yyB yyA sub xxB xxA sub Atan def } def -/HPutLine { HPosBegin /yyA ED /xxA ED /yyB ED /xxB ED HPosEnd } def -/HPutLines { HPosBegin yB yA ge { /check { le } def } { /check { ge } def -} ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { dup Y check { exit -} { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark HPosEnd -} def -/VPosBegin { xB xA lt { /t 1 t sub def } if /X xB xA sub t mul xA add def -} def -/VPosEnd { /Y X xxA sub xxB xxA sub Div yyB yyA sub mul yyA add def -/NAngle yyB yyA sub xxB xxA sub Atan def } def -/VPutLine { VPosBegin /yyA ED /xxA ED /yyB ED /xxB ED VPosEnd } def -/VPutLines { VPosBegin xB xA ge { /check { le } def } { /check { ge } def -} ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { 1 index X check { -exit } { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark -VPosEnd } def -/HPutCurve { gsave newpath /SaveLPutVar /LPutVar load def LPutVar 8 -2 -roll moveto curveto flattenpath /LPutVar [ {} {} {} {} pathforall ] cvx -def grestore exec /LPutVar /SaveLPutVar load def } def -/NCCoor { /AngleA yB yA sub xB xA sub Atan def /AngleB AngleA 180 add def -GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 xA1 yA1 ] cvx def /LPutPos { -LPutVar LPutLine } def /HPutPos { LPutVar HPutLine } def /VPutPos { -LPutVar VPutLine } def LPutVar } def -/NCLine { NCCoor tx@Dict begin ArrowA CP 4 2 roll ArrowB lineto pop pop -end } def -/NCLines { false NArray n 0 eq { NCLine } { 2 copy yA sub exch xA sub -Atan /AngleA ED n 2 mul dup index exch index yB sub exch xB sub Atan -/AngleB ED GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 n 2 mul 4 add 4 roll xA1 -yA1 ] cvx def mark LPutVar tx@Dict begin false Line end /LPutPos { -LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } -ifelse } def -/NCCurve { GetEdgeA GetEdgeB xA1 xB1 sub yA1 yB1 sub Pyth 2 div dup 3 -1 -roll mul /ArmA ED mul /ArmB ED /ArmTypeA 0 def /ArmTypeB 0 def GetArmA -GetArmB xA2 yA2 xA1 yA1 tx@Dict begin ArrowA end xB2 yB2 xB1 yB1 tx@Dict -begin ArrowB end curveto /LPutVar [ xA1 yA1 xA2 yA2 xB2 yB2 xB1 yB1 ] -cvx def /LPutPos { t LPutVar BezierMidpoint } def /HPutPos { { HPutLines -} HPutCurve } def /VPutPos { { VPutLines } HPutCurve } def } def -% -/NCAngles { - GetEdgeA GetEdgeB GetArmA GetArmB - /mtrx AngleA matrix rotate def - xA2 yA2 mtrx transform pop - xB2 yB2 mtrx transform exch pop - mtrx itransform - /y0 ED /x0 ED - mark ArmB 0 ne { xB1 yB1 } if - xB2 yB2 x0 y0 xA2 yA2 - ArmA 0 ne { xA1 yA1 } if - tx@Dict begin false Line end - /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA2 yA2 xA1 yA1 ] cvx def - /LPutPos { LPutLines } def - /HPutPos { HPutLines } def - /VPutPos { VPutLines } def } def -% -/NCAngle { - GetEdgeA GetEdgeB GetArmB - /mtrx AngleA matrix rotate def - xB2 yB2 mtrx itransform pop xA1 yA1 mtrx itransform exch pop mtrx transform - /y0 ED /x0 ED - mark - ArmB 0 ne { xB1 yB1 } if - xB2 yB2 x0 y0 xA1 yA1 - tx@Dict begin false Line end - /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA1 yA1 ] cvx def - /LPutPos { LPutLines } def - /HPutPos { HPutLines } def - /VPutPos { VPutLines } def -} def -% -/NCBar { - GetEdgeA GetEdgeB GetArmA GetArmB - /mtrx AngleA matrix rotate def - xA2 yA2 mtrx itransform pop - xB2 yB2 mtrx itransform pop - sub dup 0 mtrx transform - 3 -1 roll 0 gt - { /yB2 exch yB2 add def /xB2 exch xB2 add def } - { /yA2 exch neg yA2 add def /xA2 exch neg xA2 add def } ifelse - mark - ArmB 0 ne { xB1 yB1 } if - xB2 yB2 xA2 yA2 ArmA 0 ne { xA1 yA1 } if - tx@Dict begin false Line end - /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def - /LPutPos { LPutLines } def - /HPutPos { HPutLines } def - /VPutPos { VPutLines } def -} def -% -/NCDiag { - GetEdgeA GetEdgeB GetArmA GetArmB mark - ArmB 0 ne { xB1 yB1 } if - xB2 yB2 xA2 yA2 - ArmA 0 ne { xA1 yA1 } if - tx@Dict begin false Line end - /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def - /LPutPos { LPutLines } def - /HPutPos { HPutLines } def - /VPutPos { VPutLines } def -} def -% -/NCDiagg { - GetEdgeA GetArmA - yB yA2 sub xB xA2 sub Atan 180 add /AngleB ED - GetEdgeB - mark - xB1 yB1 xA2 yA2 - ArmA 0 ne { xA1 yA1 } if - tx@Dict begin false Line end - /LPutVar [ xB1 yB1 xA2 yA2 xA1 yA1 ] cvx def - /LPutPos { LPutLines } def - /HPutPos { HPutLines } def - /VPutPos { VPutLines } def -} def -% -/NCLoop { - GetEdgeA GetEdgeB GetArmA GetArmB - /mtrx AngleA matrix rotate def - xA2 yA2 mtrx transform loopsize add /yA3 ED /xA3 ED - /xB3 xB2 yB2 mtrx transform pop def - xB3 yA3 mtrx itransform /yB3 ED /xB3 ED - xA3 yA3 mtrx itransform /yA3 ED /xA3 ED - mark ArmB 0 ne { xB1 yB1 } if - xB2 yB2 xB3 yB3 xA3 yA3 xA2 yA2 ArmA 0 ne { xA1 yA1 } if - tx@Dict begin false Line end - /LPutVar [ xB1 yB1 xB2 yB2 xB3 yB3 xA3 yA3 xA2 yA2 xA1 yA1 ] cvx def - /LPutPos { LPutLines } def - /HPutPos { HPutLines } def - /VPutPos { VPutLines } def -} def -% -% DG/SR modification begin - May 9, 1997 - Patch 1 -%/NCCircle { 0 0 NodesepA nodeA \tx@GetEdge pop xA sub 2 div dup 2 exp r -%r mul sub abs sqrt atan 2 mul /a ED r AngleA 90 add PtoC yA add exch xA add -%exch 2 copy /LPutVar [ 4 2 roll r AngleA ] cvx def /LPutPos { LPutVar t 360 -%mul add dup 5 1 roll 90 sub \tx@PtoC 3 -1 roll add /Y ED add /X ED /NAngle ED -% -/NCCircle { - NodeSepA 0 NodeA 0 GetEdge pop - 2 div dup 2 exp r r mul sub abs sqrt - atan 2 mul /a ED - r AngleA 90 add PtoC yA add exch xA add - exch 2 copy - /LPutVar [ 4 2 roll r AngleA ] cvx def - /LPutPos { - LPutVar t 360 mul add dup 5 1 roll 90 sub PtoC - 3 -1 roll add - /Y ED add /X ED /NAngle ED -% DG/SR modification end - } def - /HPutPos { LPutPos } def - /VPutPos { LPutPos } def - r AngleA 90 sub a add AngleA 270 add a sub - tx@Dict begin - /angleB ED /angleA ED /r ED - /c 57.2957 r Div def - /y ED /x ED -} def -% -/NCBox { /d ED /h ED /AngleB yB yA sub xB xA sub Atan def /AngleA AngleB -180 add def GetEdgeA GetEdgeB /dx d AngleB sin mul def /dy d AngleB cos -mul neg def /hx h AngleB sin mul neg def /hy h AngleB cos mul def -/LPutVar [ xA1 hx add yA1 hy add xB1 hx add yB1 hy add xB1 dx add yB1 dy -add xA1 dx add yA1 dy add ] cvx def /LPutPos { LPutLines } def /HPutPos -{ xB yB xA yA LPutLine } def /VPutPos { HPutPos } def mark LPutVar -tx@Dict begin false Polygon end } def -/NCArcBox { /l ED neg /d ED /h ED /a ED /AngleA yB yA sub xB xA sub Atan -def /AngleB AngleA 180 add def /tA AngleA a sub 90 add def /tB tA a 2 -mul add def /r xB xA sub tA cos tB cos sub Div dup 0 eq { pop 1 } if def -/x0 xA r tA cos mul add def /y0 yA r tA sin mul add def /c 57.2958 r div -def /AngleA AngleA a sub 180 add def /AngleB AngleB a add 180 add def -GetEdgeA GetEdgeB /AngleA tA 180 add yA yA1 sub xA xA1 sub Pyth c mul -sub def /AngleB tB 180 add yB yB1 sub xB xB1 sub Pyth c mul add def l 0 -eq { x0 y0 r h add AngleA AngleB arc x0 y0 r d add AngleB AngleA arcn } -{ x0 y0 translate /tA AngleA l c mul add def /tB AngleB l c mul sub def -0 0 r h add tA tB arc r h add AngleB PtoC r d add AngleB PtoC 2 copy 6 2 -roll l arcto 4 { pop } repeat r d add tB PtoC l arcto 4 { pop } repeat 0 -0 r d add tB tA arcn r d add AngleA PtoC r h add AngleA PtoC 2 copy 6 2 -roll l arcto 4 { pop } repeat r h add tA PtoC l arcto 4 { pop } repeat } -ifelse closepath /LPutVar [ x0 y0 r AngleA AngleB h d ] cvx def /LPutPos -{ LPutVar /d ED /h ED /AngleB ED /AngleA ED /r ED /y0 ED /x0 ED t 1 le { -r h add AngleA 1 t sub mul AngleB t mul add dup 90 add /NAngle ED PtoC } -{ t 2 lt { /NAngle AngleB 180 add def r 2 t sub h mul t 1 sub d mul add -add AngleB PtoC } { t 3 lt { r d add AngleB 3 t sub mul AngleA 2 t sub -mul add dup 90 sub /NAngle ED PtoC } { /NAngle AngleA 180 add def r 4 t -sub d mul t 3 sub h mul add add AngleA PtoC } ifelse } ifelse } ifelse -y0 add /Y ED x0 add /X ED } def /HPutPos { LPutPos } def /VPutPos { -LPutPos } def } def -/Tfan { /AngleA yB yA sub xB xA sub Atan def GetEdgeA w xA1 xB sub yA1 yB -sub Pyth Pyth w Div CLW 2 div mul 2 div dup AngleA sin mul yA1 add /yA1 -ED AngleA cos mul xA1 add /xA1 ED /LPutVar [ xA1 yA1 m { xB w add yB xB -w sub yB } { xB yB w sub xB yB w add } ifelse xA1 yA1 ] cvx def /LPutPos -{ LPutLines } def /VPutPos@ { LPutVar flag { 8 4 roll pop pop pop pop } -{ pop pop pop pop 4 2 roll } ifelse } def /VPutPos { VPutPos@ VPutLine } -def /HPutPos { VPutPos@ HPutLine } def mark LPutVar tx@Dict begin -/ArrowA { moveto } def /ArrowB { } def false Line closepath end } def -% -/LPutCoor { - NAngle - tx@Dict begin /NAngle ED end - gsave - CM STV - CP Y sub neg exch X sub neg exch moveto - setmatrix CP - grestore -} def -% -/LPut { - tx@NodeDict /LPutPos known - { LPutPos } { CP /Y ED /X ED /NAngle 0 def } ifelse - LPutCoor -} def -% -/HPutAdjust { - Sin Cos mul 0 eq - { 0 } - { d Cos mul Sin div flag not { neg } if - h Cos mul Sin div flag { neg } if - 2 copy gt { pop } { exch pop } ifelse - } ifelse - s add flag { r add neg }{ l add } ifelse - X add /X ED -} def -% -/VPutAdjust { - Sin Cos mul - 0 eq - { 0 } - { l Sin mul Cos div flag { neg } if - r Sin mul Cos div flag not { neg } if - 2 copy gt { pop } { exch pop } ifelse - } ifelse - s add flag { d add } { h add neg } ifelse - Y add /Y ED -} def -% -end -% -% END pst-node.pro diff --git a/Master/texmf-dist/dvips/pstricks/pstricks.pro b/Master/texmf-dist/dvips/pstricks/pstricks.pro index fa156bb7488..19096f3f05c 100644 --- a/Master/texmf-dist/dvips/pstricks/pstricks.pro +++ b/Master/texmf-dist/dvips/pstricks/pstricks.pro @@ -1,4 +1,4 @@ -% $Id: pstricks.pro 90 2009-01-30 10:58:51Z herbert $ +% $Id: pstricks.pro 266 2010-01-22 14:45:23Z herbert $ % %% PostScript prologue for pstricks.tex. %% Version 1.06, 2009/01/30 @@ -72,28 +72,29 @@ tx@Dict begin /STP { .996264 dup scale } def % BP/PT scaling /STV { SDict begin normalscale end STP } def % % -%%-------------- DG begin patch 15 ---------------%% -%/DashLine { dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def -%PathLength } ifelse /b ED /x ED /y ED /z y x add def b a .5 sub 2 mul y -%mul sub z Div round z mul a .5 sub 2 mul y mul add b exch Div dup y mul -%/y ED x mul /x ED x 0 gt y 0 gt and { [ y x ] 1 a sub y mul } { [ 1 0 ] -%0 } ifelse setdash stroke } def /DashLine { - dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def PathLength } ifelse - /b ED /x1 ED /y1 ED /x ED /y ED - /z y x add y1 add x1 add def - /Coef b a .5 sub 2 mul y mul sub z Div round - z mul a .5 sub 2 mul y mul add b exch Div def - /y y Coef mul def - /x x Coef mul def - /y1 y1 Coef mul def - /x1 x1 Coef mul def - x1 0 gt y1 0 gt or x 0 gt or y 0 gt and - { [ y x y1 x1 ] 1 a sub y mul } - { [ 1 0 ] 0 } ifelse - setdash stroke -} def -%%-------------- DG end patch 15 ---------------%% + dup 0 gt + { /a .5 def PathLength exch div } + { pop /a 1 def PathLength } ifelse + /b ED % pattern should fit evenly in b + dup /X ED % pattern array + 0 get /y ED % length of first black segment + /z 0 X {add} forall def % length of the full pattern + %% Computation of the scaling factor as described by van Zandt: + b a .5 sub 2 mul y mul sub z Div round + z mul a .5 sub 2 mul y mul add b exch Div + %%%% scaling factor on stack. + /z ED %% now, z is the scaling factor + false % for the length test below + X { z mul } forall X astore %% modification TN 04-08-07 + %%% Checking whether at least one dash in X has positive length: + {0 gt or} forall + { X 1 a sub y mul } + { [ 1 0 ] 0 } + ifelse + setdash stroke +} def +% /DotLine { /b PathLength def /a ED /z ED /y CLW def @@ -112,6 +113,35 @@ tx@Dict begin setdash 1 setlinecap stroke } def % +/SymbolLine { % on stack [ x y x y ... + counttomark % number of elements + 2 div cvi /n ED % n pairs + /YA ED /XA ED % the start point + n 1 sub { + /YB ED /XB ED + /XLength XB XA sub def + /YLength YB YA sub def + /PAngle YLength XLength Atan def + /XYLength XLength YLength Pyth def + /nSym XYLength SymStep div cvi def + /Shift Symbol stringwidth pop 2 div def + /deltaX XLength nSym div def + /deltaY YLength nSym div def + XA Shift sub YA Shift sub moveto + nSym { + gsave rotateSymbol { PAngle 180 sub CorrAngle sub rotate } if + Symbol show + grestore + deltaX deltaY rmoveto + } repeat + /YA YB def /XA XB def + } repeat + XA Shift sub YA Shift sub moveto + gsave rotateSymbol { PAngle 180 sub CorrAngle sub rotate } if + Symbol show grestore + pop % delete the mark symbol +} def +% /LineFill { % hv ------------ patch 7 ------------- gsave abs /hatchWidthInc ED @@ -167,21 +197,6 @@ tx@Dict begin pop pop } def % -%gsave abs CLW add /a ED a 0 dtransform round exch round exch -%2 copy idtransform exch Atan rotate idtransform pop /a ED .25 .25 -%% DG/SR modification begin - Dec. 12, 1997 - Patch 2 -%%itransform translate pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a -%itransform pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a -%% DG/SR modification end -%Div cvi /x1 ED /y2 y2 y1 sub def clip newpath 2 setlinecap systemdict -%/setstrokeadjust known { true setstrokeadjust } if x2 x1 sub 1 add { x1 -%% DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) -%% a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore } -%% def -%a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore -%pop pop } def -%% DG/SR modification end -% /BeginArrow { ADict begin % hold it local, for end see EndArrow /@mtrx CM def @@ -253,24 +268,25 @@ tx@Dict begin /SD { 0 360 arc fill } def % /EndDot { % DS is the dot size - { /z DS def } { /z 0 def } ifelse - /b ED 0 z DS SD b { 0 z DS CLW sub SD } if - 0 DS z add CLW 4 div sub moveto } def + { /z DS def } { /z 0 def } ifelse % outer or inner dimen + /b ED % the color definition + 0 z DS SD + b { 0 z DS CLW sub SD } if + 0 DS z add CLW 4 div sub + moveto +} def % /Shadow { [ { /moveto load } { /lineto load } { /curveto load } { /closepath load } /pathforall load stopped { pop pop pop pop CP /moveto load } if ] cvx newpath 3 1 roll T exec } def % -%/NArray { -% aload length 2 div dup dup cvi eq not { exch pop } if /n exch -% cvi def -%} def -% /NArray { % holds the coordinates and on top of stack the showpoints boolean /showpoints ED - counttomark 2 div dup cvi /n ED - n eq not { exch pop } if - showpoints { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse + counttomark 2 div dup cvi /n ED % n 2 div on stack + n eq not { exch pop } if % even numbers of points? delete one + showpoints + { ] aload /Points ED } + { n 2 mul 1 add -1 roll pop } ifelse % delete the mark symbol } def % /Line { @@ -281,6 +297,30 @@ tx@Dict begin } if } def % +/LineToYAxis { + NArray % all x-y pairs on stack + n { 2 copy moveto % go to current point + 0 exch Lineto % line to y-axis + pop % delete old x-value + } repeat +} def +% +/LineToXAxis{ + NArray % all x-y pairs on stack + n 0 eq not + { n 1 eq { 0 0 /n 2 def } if + ArrowA + /n n 2 sub def + CP 2 copy moveto pop 0 Lineto + n { 2 copy moveto pop 0 Lineto } repeat + CP + 4 2 roll + ArrowB + 2 copy moveto pop 0 + L + pop pop } if +} def +% /Arcto { /a [ 6 -2 roll ] cvx def a r @@ -288,13 +328,57 @@ tx@Dict begin a } def % -/CheckClosed { dup n 2 mul 1 sub index eq 2 index n 2 mul 1 add index eq - and { pop pop /n n 1 sub def } if } def -/Polygon { NArray n 2 eq { 0 0 /n 3 def } if n 3 lt { n { pop pop } - repeat } { n 3 gt { CheckClosed } if n 2 mul -2 roll /y0 ED /x0 ED /y1 - ED /x1 ED x1 y1 /x1 x0 x1 add 2 div def /y1 y0 y1 add 2 div def x1 y1 - moveto /n n 2 sub def n { Lineto } repeat x1 y1 x0 y0 6 4 roll Lineto - Lineto pop pop closepath } ifelse } def +/CheckClosed { + dup n 2 mul 1 sub index eq 2 index n 2 mul 1 add index eq + and { pop pop /n n 1 sub def } if +} def +% +/Polygon { + NArray n 2 eq { 0 0 /n 3 def } if + n 3 lt + { n { pop pop } repeat } + { n 3 gt { CheckClosed } if + n 2 mul -2 roll + /y0 ED /x0 ED /y1 ED /x1 ED + x1 y1 + /x1 x0 x1 add 2 div def + /y1 y0 y1 add 2 div def + x1 y1 moveto + /n n 2 sub def + n { Lineto } repeat + x1 y1 x0 y0 6 4 roll Lineto + Lineto pop pop closepath } ifelse +} def +% +/SymbolPolygon { % on stack [ x y x y ... + counttomark % number of elements + 2 add /m ED + 2 copy m 2 roll % copy last two + m 2 div cvi /n ED % n pairs + /YA ED /XA ED % the start point + n 1 sub { + /YB ED /XB ED + /XLength XB XA sub def + /YLength YB YA sub def + /PAngle YLength XLength Atan def + /XYLength XLength YLength Pyth def + /nSym XYLength SymStep Div cvi def + /Shift Symbol stringwidth pop 2 Div def + /deltaX XLength nSym Div def + /deltaY YLength nSym Div def + XA Shift sub YA Shift sub moveto + nSym { + gsave rotateSymbol { PAngle 180 sub CorrAngle sub rotate } if + Symbol show + grestore + deltaX deltaY rmoveto + } repeat +% XB Shift sub YB Shift sub moveto Symbol show + /YA YB def /XA XB def + } repeat + pop % delete the mark symbol +} def +% /Diamond { /mtrx CM def T rotate @@ -310,12 +394,6 @@ tx@Dict begin /ArrowB { } def false Line closepath mtrx setmatrix } def -% DG modification begin - Jan. 15, 1997 -%/Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup 0 eq { -%pop } { CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 -%div dup cos exch sin Div mul sub def } ifelse mark 0 d w neg d 0 h w d 0 -%d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx -%setmatrix } def % /Triangle { /mtrx CM def @@ -383,6 +461,39 @@ tx@Dict begin { BOC /n n 3 sub def n { NC } repeat EOC } ifelse } def % +/CurvePath { + flattenpath /z 0 def /z0 0 def + { /y1 ED /x1 ED /y2 y1 def /x2 x1 def + x1 Shift sub y1 Shift sub moveto + gsave + startAngle rotate Symbol show + grestore /z0 z def } + { /y ED /x ED PathLength@ z z0 sub SymStep ge { + x Shift sub y Shift sub moveto + gsave + rotateSymbol { y yOld sub x xOld sub Atan 180 sub CorrAngle sub rotate } if + Symbol show + grestore /z0 z def } if + /yOld y def /xOld x def } + {} + { /y y2 def /x x2 def PathLength@ + x Shift sub y Shift sub moveto + gsave + rotateSymbol { y yOld sub x xOld sub Atan 180 sub CorrAngle sub rotate } if + Symbol show + grestore + } + pathforall + z +} def +% +/OpenSymbolCurve { + OpenCurve + 0.1 setflat + /Shift Symbol stringwidth pop 2 div def + CurvePath +} def +% /AltCurve { { false NArray n 2 mul 2 roll [ n 2 mul 3 sub 1 roll ] aload @@ -392,6 +503,13 @@ tx@Dict begin n 4 lt { n { pop pop } repeat } { BAC /n n 4 sub def n { NAC } repeat EAC } ifelse } def % +/AltOpenSymbolCurve { + AltCurve + 0.1 setflat + /Shift Symbol stringwidth pop 2 div def + CurvePath +} def +% /ClosedCurve { NArray n 3 lt { n { pop pop } repeat } @@ -402,6 +520,13 @@ tx@Dict begin } ifelse } def % +/ClosedSymbolCurve { + ClosedCurve + 0.1 setflat + /Shift Symbol stringwidth pop 2 div def + CurvePath +} def +% /SQ { /r ED r r moveto r r neg L r neg r neg L r neg r L fill } def /ST { /y ED /x ED x y moveto x neg y L 0 x L fill } def /SP { /r ED gsave 0 r moveto 4 { 72 rotate 0 r L } repeat fill grestore } def @@ -469,6 +594,13 @@ tx@Dict begin 6 2 roll 4 2 roll ArrowB curveto } ifelse } def % +/OpenSymbolBezier { + OpenBezier + 0.1 setflat + /Shift Symbol stringwidth pop 2 div def + CurvePath +} def +% /ClosedBezier { BezierNArray n 1 eq @@ -478,6 +610,19 @@ tx@Dict begin closepath } ifelse } def % +/ClosedSymbolBezier { + /f ED % save showpoints value + 2 copy /yEnd ED /xEnd ED + counttomark -2 roll 2 copy /yStart ED /xStart ED + counttomark 2 roll + f + ClosedBezier + 0.1 setflat + /Shift Symbol stringwidth pop 2 div def + CurvePath + [ xEnd yEnd xStart yStart SymbolLine +} def +% /BezierShowPoints { gsave Points aload length 2 div cvi /n ED @@ -497,6 +642,21 @@ tx@Dict begin /Points [ x1 y1 x0 y0 x0 2 mul x1 sub y1 ] def } def % +/Parab1 { % 1 end | 0 SP + /ySP ED /xSP ED /y1 ED /x1 ED + /dx xSP x1 sub 3 div def + /dy ySP y1 sub 3 div def + newpath x1 y1 moveto xSP y1 lineto xSP ySP lineto + x1 ySP lineto closepath clip + currentpoint + newpath moveto + xSP dx sub ySP dy add x1 y1 ArrowA + xSP dx add ySP dy add xSP 2 mul x1 sub y1 ArrowB + curveto + /Points [ x1 y1 xSP ySP xSP 2 mul x1 sub y1 ] def +} def +% +% /Grid { newpath /a 4 string def @@ -737,6 +897,41 @@ dup angle0 sub dup abs 180 gt { 180 add 360 div floor 360 mul sub } { pop } ifel /IfVisible true def } def % +%%%%%%%%%%%%%%%%% tools %%%%%%%%%%%%%%%%%%%%%%%%% +%%%%% ### bubblesort ### +%% syntax : array bubblesort --> array2 trie par ordre croissant +%% code de Bill Casselman +%% http://www.math.ubc.ca/people/faculty/cass/graphics/text/www/ +/bubblesort { +4 dict begin + /a exch def + /n a length 1 sub def + n 0 gt { + % at this point only the n+1 items in the bottom of a remain to + % the sorted largest item in that blocks is to be moved up into + % position n + n { + 0 1 n 1 sub { + /i exch def + a i get a i 1 add get gt { + % if a[i] > a[i+1] swap a[i] and a[i+1] + a i 1 add + a i get + a i a i 1 add get + % set new a[i] = old a[i+1] + put + % set new a[i+1] = old a[i] + put + } if + } for + /n n 1 sub def + } repeat + } if + a +end +} def +% +% end %-----------------------------------------------------------------------------% % |