summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-08-12 16:09:08 +0000
committerKarl Berry <karl@freefriends.org>2006-08-12 16:09:08 +0000
commitd850ed90db1a9f0924025751583132c068c524ee (patch)
treee4e64e69a6f99d9daf10f9b26e2c0b375d81a21a /Master/texmf-dist/dvips
parentc6141418a8cc97b3ebbf324c22c27c20dfd95063 (diff)
pstricks 2006/08/10 update
git-svn-id: svn://tug.org/texlive/trunk@1935 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips')
-rw-r--r--Master/texmf-dist/dvips/pstricks/Changes9
-rw-r--r--Master/texmf-dist/dvips/pstricks/pst-text.pro18
-rw-r--r--Master/texmf-dist/dvips/pstricks/pstricks.pro68
3 files changed, 62 insertions, 33 deletions
diff --git a/Master/texmf-dist/dvips/pstricks/Changes b/Master/texmf-dist/dvips/pstricks/Changes
index 73c4f68079d..e93b5fb61ae 100644
--- a/Master/texmf-dist/dvips/pstricks/Changes
+++ b/Master/texmf-dist/dvips/pstricks/Changes
@@ -1,4 +1,13 @@
---- pstricks.pro
+1.01 2006-01-11 (vg) fix a bug with ArcAdjust when both angles ares negative
+ (hv) add Sqrt sunction
+1.00 2005-09-19 (hv) move the code for arcs of an ellipse from
+ the main pstricks.tex into this pro
+97, patch 7 2005-09-11 (hv) added new fillstyles
97, patch 6 2005-05-17 (hv) added some helper stuff
RadtoDeg, DegtoRad, Pi, TwoPi, ATAN
97, patch 5 2005-03-08 (hv) bugfix for DashLine
+
+
+---- pst-text.pro
+1.00 2005-11-29 (hv) add a patch for japanese text \ No newline at end of file
diff --git a/Master/texmf-dist/dvips/pstricks/pst-text.pro b/Master/texmf-dist/dvips/pstricks/pst-text.pro
index 2f001e2af23..0e918ee570d 100644
--- a/Master/texmf-dist/dvips/pstricks/pst-text.pro
+++ b/Master/texmf-dist/dvips/pstricks/pst-text.pro
@@ -1,6 +1,6 @@
%!
% PostScript header file pst-text.pro
-% Version 97, 94/04/20; patched MV 10-09-99 00:36
+% Version 1.00, 2005/12/15
% For distribution, see pstricks.tex.
/tx@TextPathDict 40 dict def
@@ -50,9 +50,19 @@ tx@TextPathDict begin
/TextPathShow
{ /String exch def
/CharCount 0 def
- String length
- { String CharCount 1 getinterval ShowChar
- /CharCount CharCount 1 add def
+% hv begin 2005-11-29 1.00
+% String length
+% { String CharCount 1 getinterval ShowChar
+% /CharCount CharCount 1 add def
+ /CharSize 1 def
+ currentfont /FontType get 0 eq
+ { currentfont /FMapType get dup 2 eq exch dup 5 eq exch 9 eq or or
+ { /CharSize 2 def} if
+ } if
+ String length CharSize idiv
+ { String CharCount CharSize getinterval ShowChar
+ /CharCount CharCount CharSize add def
+% hv end 2005-11-29 1.00
} repeat
} def
diff --git a/Master/texmf-dist/dvips/pstricks/pstricks.pro b/Master/texmf-dist/dvips/pstricks/pstricks.pro
index 8c67d1cb7da..3418879b649 100644
--- a/Master/texmf-dist/dvips/pstricks/pstricks.pro
+++ b/Master/texmf-dist/dvips/pstricks/pstricks.pro
@@ -1,6 +1,6 @@
%!
% PostScript prologue for pstricks.tex.
-% Version 1.00, 2005/09/18
+% Version 1.01, 2006/01/11
% For distribution, see pstricks.tex.
%
/tx@Dict 200 dict def tx@Dict begin
@@ -14,7 +14,8 @@
/T /translate load def
/TMatrix { } def
/RAngle { 0 } def
-/Atan { /atan load stopped { pop pop 0 } if } def
+/Sqrt { dup 0 lt { pop 0 } { sqrt } ifelse } def% return 0 for negative arguments
+/Atan { /atan load stopped { pop pop 0 } if } def% return 0 if atan not known
/ATAN1 {neg -1 atan 180 sub } def % atan(x) (only one parameter)
/Div { dup 0 eq { pop } { div } ifelse } def % control the division
/NET { neg exch neg exch T } def % change coordinate system to the negative one
@@ -24,8 +25,8 @@
/Pi 3.14159265359 def
/TwoPi 6.28318530718 def
/Euler 2.71828182846 def
-/RadtoDeg { 180 mul Pi div } def % convert from radian to degrees
-/DegtoRad { Pi mul 180 div } def % viceversa
+/RadtoDeg { 180 mul Pi div } bind def % convert from radian to degrees
+/DegtoRad { Pi mul 180 div } bind def % viceversa
%----------------- hv end---------------------------
/PathLength@ { /z z y y1 sub x x1 sub Pyth add def /y1 y def /x1 x def } def
/PathLength { flattenpath /z 0 def
@@ -291,10 +292,11 @@ exch r a PtoC y add exch x add exch b pop pop pop pop a e d CLW 8 div c
mul neg d } def
/Ellipse { /mtrx CM def T scale 0 0 1 5 3 roll arc mtrx setmatrix } def
%
-/ArcAdjust {
+/ArcAdjust { %%%% Vincent Guirardel
% given a target length (targetLength) and an initial angle (angle0) [in the stack],
% let M(angle0)=(rx*cos(angle0),ry*sin(angle0))=(x0,y0).
-% This computes an angle t such that (x0,y0) is at distance targetLength from the point M(t)=(rx*cos(t),ry*sin(t)).
+% This computes an angle t such that (x0,y0) is at distance
+% targetLength from the point M(t)=(rx*cos(t),ry*sin(t)).
% NOTE: this an absolute angle, it does not have to be added or substracted to angle0
% contrary to TvZ's code.
% To achieve, this, one iterates the following process: start with some angle t,
@@ -309,46 +311,54 @@ mul neg d } def
% Input stack: 1: target length 2: initial angle
% variables used : rx, ry, d (=add/sub)
%
- /targetLength ED /angle0 ED
- /x0 rx angle0 cos mul def
- /y0 ry angle0 sin mul def
-% we are looking for an angle t such that (x0,y0) is at distance targetLength from the point M(t)=(rx*cos(t),ry*sin(t)))
+ /targetLength ED /angle0 ED
+ /x0 rx angle0 cos mul def
+ /y0 ry angle0 sin mul def
+% we are looking for an angle t such that (x0,y0) is at distance targetLength
+% from the point M(t)=(rx*cos(t),ry*sin(t)))
%initialisation of angle (using 1st order approx = TvZ's code)
- targetLength 57.2958 mul
- angle0 sin rx mul dup mul
- angle0 cos ry mul dup mul
- add sqrt div
+ targetLength 57.2958 mul
+ angle0 sin rx mul dup mul
+ angle0 cos ry mul dup mul
+ add sqrt div
% if initialisation angle is two large (more than 90 degrees) set it to 90 degrees
-% (if the ellipse is very curved at the point where we draw the arrow, the value can be much more than 360 degrees !)
+% (if the ellipse is very curved at the point where we draw the arrow, %
+% the value can be much more than 360 degrees !)
% this should avoid going on the wrong side (more than 180 degrees) or go near
% a bad attractive point (at 180 degrees)
- dup 90 ge { pop 90 } if
- angle0 exch d
+ dup 90 ge { pop 90 } if
+ angle0 exch d % add or sub
% maximum number of times to iterate the iterative procedure:
- 30
-% iterative procedure: takes an angle t on top of stack, computes a better angle (an put it on top of stack)
- { dup
+% iterative procedure: takes an angle t on top of stack, computes a
+% better angle (and put it on top of stack)
+ 30 { dup
% compute distance D between (x0,y0) and M(t)
- dup cos rx mul x0 sub dup mul exch sin ry mul y0 sub dup mul add sqrt
+ dup cos rx mul x0 sub dup mul exch sin ry mul y0 sub dup mul add sqrt
% if D almost equals targetLength, we stop
- dup targetLength sub abs 1e-5 le { pop exit } if
+ dup targetLength sub abs 1e-5 le { pop exit } if
% stack now contains D t
% compute the point M(t') at distance targetLength of (x0,y0) on the semi-line [(x0,y0) M(t)]:
% M(t')= ( (x(t)-x0)*targetLength/d+x0 , (y(t)-y0)*targetLength/d+y0 )
- exch dup cos rx mul x0 sub exch sin ry mul y0 sub
+ exch dup cos rx mul x0 sub exch sin ry mul y0 sub
% stack contains: y(t)-y0, x(t)-x0, d
- 2 index Div targetLength mul y0 add ry Div exch
- 2 index Div targetLength mul x0 add rx Div
+ 2 index Div targetLength mul y0 add ry Div exch
+ 2 index Div targetLength mul x0 add rx Div
% stack contains x(t')/rx , y(t')/ry , d
% now compute t', and remove D from stack
- atan exch pop
- } repeat
-% we don't look at what happened... in particular, if targetLength is greater than the diameter of the ellipse...
+ atan exch pop
+ } repeat
+% we don't look at what happened... in particular, if targetLength is greater
+% than the diameter of the ellipse...
% the final angle will be around /angle0 + 180. maybe we should treat this pathological case...
-%after iteration, stack contains an angle t such that M(t) is the tail of the arrow
+% after iteration, stack contains an angle t such that M(t) is the tail of the arrow
% to give back the result as a an angle relative to angle0 we could add the following line:
% angle0 sub 0 exch d
%
+% begin bug fix 2006-01-11
+% we want to adjust the new angle t' by a multiple of 360 so that | t'-angle0 | <= 180
+%(we don't want to make the ellipse turn more or less than it should)...
+dup angle0 sub dup abs 180 gt { 180 add 360 div floor 360 mul sub } { pop } ifelse
+% end bug fix
} def
%
/EllipticArcArrow {