From 8322a8a248262d9acaadab2fa12d90012fcf1877 Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sat, 25 Sep 2021 03:01:31 +0000
Subject: CTAN sync 202109250301

---
 graphics/pstricks/base/generic/pstricks.tex | 400 ++++++----------------------
 1 file changed, 87 insertions(+), 313 deletions(-)

(limited to 'graphics/pstricks/base/generic/pstricks.tex')

diff --git a/graphics/pstricks/base/generic/pstricks.tex b/graphics/pstricks/base/generic/pstricks.tex
index 80005b22d0..36976bf0a6 100644
--- a/graphics/pstricks/base/generic/pstricks.tex
+++ b/graphics/pstricks/base/generic/pstricks.tex
@@ -81,8 +81,8 @@
 \fi
 \let\pgfforeach\foreach
 %
-\def\fileversion{3.08}
-\def\filedate{2021/09/10}
+\def\fileversion{3.10}
+\def\filedate{2021/09/23}
 \pst@addfams{pstricks}
 %
 %\define@boolkey[psset]{pstricks}[Pst@]{useURWfonts}[true]{}
@@ -764,7 +764,6 @@
 \def\radians{\def\pst@angleunit{57.2956 mul }%
   \pstVerb{tx@Dict begin startGlobal /pst@angleunit {\pst@angleunit} def endGlobal end}}%
 \def\pst@angleunit{}%
-
 %
 \def\SpecialCoor{%
   \def\pst@@getcoor##1{%
@@ -1356,78 +1355,56 @@
 \define@boolkey[psset]{pstricks}[Pst@]{variableColor}[true]{}
 \define@key[psset]{pstricks}{setflat}[0.1]{\pst@checknum{#1}\psk@setflat}%
 \psset[pstricks]{startLW=\pslinewidth,endLW=\pslinewidth,variableColor=false,
-  variableLW=false,startWL=380,endWL=780,setflat=0.1}
+  variableLW=false,startWL=380,endWL=770,setflat=0.1}
 %
 \def\pst@flattenpath{
-  /Coors [] def         % the array of all points
-  50 dict begin
-  /lambda \psk@startWL\space def
-  %
+  20 dict begin
+  /Coors [] def
+  /Cmds [] def
+  /NoOfSteps 0 def
   /add2Values { Coors aload length 2 add array astore /Coors exch def } def
   /add6Values { Coors aload length 6 add array astore /Coors exch def } def
-%
-  \psk@setflat\space setflat   % the value for the line snippets
-  flattenpath            % flatten the existing path into line segments
-%
-  { add2Values }         % what to do with moveto
-  { add2Values }         % what to do with lineto 
-  { add6Values }         % what to do with curveto (not needed here) 
-  { }                    % what to do with closepath
-  pathforall             % do it for the existing path
-%
+  /addmoveto { -1 Cmds aload length 1 add array astore /Cmds exch def } def
+  /addlineto { 0 Cmds aload length 1 add array astore /Cmds exch def } def
+  /addcurveto { 1 Cmds aload length 1 add array astore /Cmds exch def } def
+  \psk@setflat\space setflat      % the value for the line snippets
+  flattenpath                     % flatten the existing path into line segments
+  { add2Values addmoveto}         % what to do with moveto
+  { NoOfSteps 1 add /NoOfSteps ED add2Values addlineto}         % what to do with lineto 
+  { NoOfSteps 1 add /NoOfSteps ED add6Values addcurveto}          % what to do with curveto (not needed here) 
+  { }                             % nothing for closepath
+  pathforall
+%
+  /dLW \pst@number\psk@endLW \pst@number\psk@startLW sub NoOfSteps div def % the step for the linewidth
+  \ifPst@variableColor
+    /dColor \psk@endWL\space \psk@startWL\space sub NoOfSteps div def      % same for color
+  \fi
+%%%  
   \pst@number\psk@startLW setlinewidth
   \tx@setlinejoin
   \psk@linecap\space setlinecap
-  Coors aload length 2 sub 2 div cvi /N0 exch def % set number of points
-  /NN 0 def
-  /N N0 def
-  { N 3 gt { N 3 sub /N ED }{ N 1 sub /N ED } ifelse 
-    NN 1 add /NN ED
-    N 0 eq { exit } if
-  } loop
-  /dLW \pst@number\psk@endLW \pst@number\psk@startLW sub NN div def          % the step for the linewidth
-  \ifPst@variableColor
-    /dColor \psk@endWL\space \psk@startWL\space sub NN div def
-    lambda dColor add dup /lambda ED 
-    tx@addDict begin wavelengthToRGB Red Green Blue end setrgbcolor
-  \else
-    \pst@usecolor\pslinecolor
-  \fi
-  moveto                 % move to the first one
-  /N N0 def
-  {
-    N 3 gt {  
-%    CP 6 2 roll
-    \psk@curvature\space /c ED /b ED /a ED
-    /ArrowA {} def
-    /ArrowB {} def
-    BOC NC EOC %    curveto 
-    N 3 sub /N ED }{ lineto N 1 sub /N ED } ifelse
-    currentlinewidth dLW add setlinewidth % increase line width
+  /lambda \psk@startWL def
+  Cmds length /Ncmds ED    % number of the commands is the length of the array
+  /CoorIndex 0 def
+  Ncmds 1 sub -1 0 {
+    % on stack is the loop index 
+    Cmds exch get /cmdNo ED      % get command as nuber -1, 0, 1 | moveto, lineto, curveto
+    cmdNo 0 eq { Coors CoorIndex 2 getinterval aload pop lineto CoorIndex 2 add /CoorIndex ED }
+      { cmdNo 0 lt { Coors CoorIndex 2 getinterval aload pop moveto CoorIndex 2 add /CoorIndex ED }
+        { Coors CoorIndex 6 getinterval aload pop curveto CoorIndex 6 add /CoorIndex ED } ifelse } ifelse  % else is curveto
     \ifPst@variableColor
       lambda dColor add dup /lambda ED 
       tx@addDict begin wavelengthToRGB Red Green Blue end setrgbcolor
     \else
       \pst@usecolor\pslinecolor
     \fi
-    CP /Y ED /X ED       % put coors of current point on the stack
-%    0.4 .setopacityalpha 
+    currentlinewidth dLW add setlinewidth
+    CP /yCurr ED /xCurr ED
     stroke               % draw the line segment
-    N 0 eq { exit }{ X Y moveto } ifelse
-  } loop
-%  N {                    % repeat for the other N coords
-%    lineto               % line to next point
-%    currentlinewidth dLW add setlinewidth % increase line width
-%    lambda dColor add dup /lambda ED 
-%    tx@addDict begin wavelengthToRGB Red Green Blue end setrgbcolor
-%    currentpoint         % put coors of current point on the stack
-%    0.4 .setopacityalpha 
-%    stroke               % draw the line segment
-%    moveto
-%  } repeat
+    xCurr yCurr moveto   % go to the last point
+  } for
   end
 }
-
 %
 %--------------------------- A R R O W S ---------------------------
 
@@ -1993,227 +1970,9 @@
   \end@OpenObj
 }
 %
-\define@key[psset]{pstricks}{dotsize}[2pt 2]{%
-  \pst@expandafter\pst@getdimnum{#1} 0 {} {}\@nil%
-  \edef\psk@@dotsize{\pst@number\pst@dimg}%
-  \let\psk@@@dotsize\pst@tempg%
-  \edef\psk@dotsize{ /DS \psk@@dotsize \psk@@@dotsize CLW mul add 2 div def }}
-\psset[pstricks]{dotsize=2pt 2}
-%
-\define@key[psset]{pstricks}{dotscale}[1]{%
-  \pst@getscale{#1}\psk@dotscale
-  \ifx\psk@dotscale\@empty
-    \def\psk@xdotscale{1 }%
-    \def\psk@ydotscale{1 }%
-  \else
-    \let\psk@xdotscale\pst@tempg
-    \let\psk@ydotscale\pst@temph
-  \fi}
-%
-\def\pst@Getangle#1#2{%
-  \pst@getangle{#1}\pst@tempg
-  \def\pst@temph{0. }%
-  \ifx\pst@tempg\pst@temph\def#2{}\else\edef#2{\pst@tempg\space rotate }\fi}
-%
-\define@key[psset]{pstricks}{dotangle}[0]{%
-  \pst@getangle{#1}\psk@@dotangle
-  \ifdim\psk@@dotangle\p@=\z@
-    \let\psk@dotangle\@empty
-  \else
-    \edef\psk@dotangle{\psk@@dotangle rotate }%
-  \fi}
-\psset[pstricks]{dotangle=0}
-%
-\def\pst@getdotsize{%
-\pst@dimg=\psk@@@dotsize\pslinewidth
-\advance\pst@dimg\psk@@dotsize\p@
-\pst@dimh=\psk@ydotscale\pst@dimg
-\pst@dimg=\psk@xdotscale\pst@dimg
-\divide\pst@dimh 2
-\divide\pst@dimg 2\relax}
-%
-\psset[pstricks]{dotscale=1}
-%
-\def\psdot{\pst@object{psdot}}
-\def\psdot@i{\@ifnextchar({\psdot@ii}{\psdot@ii(\z@,\z@)}}
-\def\psdot@ii(#1){%
-  \begin@SpecialObj%
-% hv modification 1.13 2005-11-28 
-  \solid@star%
-% hv modification end 
-  \pst@@getcoor{#1}%
-  \addto@pscode{
-    \psk@dotsize
-    \@nameuse{psds@\psk@dotstyle}
-    \tx@setStrokeTransparency
-    \pst@coor Dot}%
-  \end@SpecialObj}
-%
-\def\psdots{\pst@object{psdots}}
-\def\psdots@i{%
-  \begin@SpecialObj%
-  \pst@getcoors[\psdots@ii}
-\def\psdots@ii{%
-  \addto@pscode{ false \tx@NArray \psdots@iii }%
-  \end@SpecialObj}
-\def\psdots@iii{%
-  \psk@dotsize
-  \@nameuse{psds@\psk@dotstyle}
-  \tx@setStrokeTransparency
-  newpath
-  n { transform floor .5 add exch floor .5 add exch itransform Dot  } repeat }
-%
-% DG: dead code (to suppress until \psset[pstricks]{dotstyle) ? - Aug. 4, 1997
-\def\tx@SQ{SQ }
-\def\tx@ST{ST }
-\def\tx@SP{SP }
-%
-\def\pst@gdot#1{ /Dot { gsave T \psk@dotangle \psk@dotscale #1 grestore } def }
-%
-\@namedef{psds@*}{\pst@gdot{ 0 0 DS \tx@SD }}
-\@namedef{psds@o}{%
-  /r2 DS CLW sub def
-  \pst@gdot{ 0 0 DS \tx@SD \pst@usecolor\psfillcolor SLW 0 0 r2 \tx@SD }}
-\@namedef{psds@square*}{ /r1 DS .886 mul def \pst@gdot{r1 \tx@SQ }}
-\@namedef{psds@square}{%
-  /r1 DS .886 mul def /r2 r1 CLW sub def
-  \pst@gdot{r1 \tx@SQ \pst@usecolor\psfillcolor r2 \tx@SQ}}
-\@namedef{psds@triangle*}{%
-  /y1 DS .778 mul neg def /x1 y1 1.732 mul neg def
-  \pst@gdot{x1 y1 \tx@ST}}
-\@namedef{psds@triangle}{%
-  /y1 DS .778 mul neg def /x1 y1 1.732 mul neg def
-  /y2 y1 CLW add def /x2 y2 1.732 mul neg def
-  \pst@gdot{x1 y1 \tx@ST  x2 y2 \tx@ST}}
-\@namedef{psds@pentagon*}{%
-  /r1 DS 1.149 mul def
-  \pst@gdot{r1 \tx@SP}}
-\@namedef{psds@pentagon}{%
-  DS .93 mul dup 1.236 mul /r1 ED CLW sub 1.236 mul /r2 ED
-  \pst@gdot{r1 \tx@SP  r2 \tx@SP}}
-\@namedef{psds@+}{%
-  /DS DS 1.253 mul def
-  \pst@gdot{DS 0 moveto DS neg 0 L stroke 0 DS moveto 0 DS neg L stroke}}
-\@namedef{psds@|}{%
-  \psk@tbarsize CLW mul add 2 div /DS ED
-  \pst@gdot{0 DS moveto 0 DS neg L stroke}}
-% DG: end dead code?
-%
-\define@key[psset]{pstricks}{dotstyle}[*]{%
-  \@ifundefined{psds@#1}%
-    {\@pstrickserr{Dot style `#1' not defined}\@eha}%
-    {\edef\psk@dotstyle{#1}}}
-\psset[pstricks]{dotstyle=*}
-%
-\def\tx@FontDot{FontDot }
-\def\newpsfontdot#1[#2]#3#4{%
-  \@namedef{psds@#1}{%
-    /#3 \psk@@dotangle [#2] \tx@FontDot
-% DG/SR modification begin - Dec. 12, 1999 - Patch 14
-%/Dot { moveto #4 show } bind def }}
-    /Dot { moveto gsave \psk@dotscale #4 show grestore } bind def 
-}}
-% DG/SR modification end
-\def\newpsfontdotH#1[#2]#3#4#5{%	for filled objects
-  \@namedef{psds@#1}{%
-    /#3 \psk@@dotangle [#2] \tx@FontDot
-    /Dot {
-      moveto
-%      \iftrue
-% DG/SR modification begin - Dec. 23, 1999 - Patch 14
-%gsave \pst@usecolor\psfillcolor #5 show grestore
-%\fi
-%#4 show
-      gsave \psk@dotscale \pst@usecolor\psfillcolor #5 show grestore % fill first
-%      \fi					
-      gsave \psk@dotscale #4 show grestore	% show the unfilled one
-% DG/SR modification end
-    } bind def 
-}}
-%
-\pstheader{pst-dots.pro}
-
-\pstGSfontsfalse
-
-\newpsfontdot{*}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(b)}
-\newpsfontdotH{o}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(c)}{(b)}
-\newpsfontdotH{Bo}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(C)}{(b)}
-\newpsfontdotH{triangle}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(t)}{(u)}
-\newpsfontdotH{Btriangle}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(T)}{(u)}
-\newpsfontdot{triangle*}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(u)}
-\newpsfontdotH{square}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(s)}{(r)}
-\newpsfontdotH{Bsquare}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(S)}{(r)}
-\newpsfontdot{square*}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(r)}
-\newpsfontdotH{pentagon}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(p)}{(q)}
-\newpsfontdotH{Bpentagon}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(P)}{(q)}
-\newpsfontdot{pentagon*}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(q)}
-% D.G. modification begin - Jan. 17, 2000
-\newpsfontdotH{diamond}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(d)}{(l)}
-\newpsfontdotH{Bdiamond}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(D)}{(l)}
-\newpsfontdot{diamond*}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(l)}
-% DG/SR modification end
-% Etienne Riga
-\newpsfontdot{Asterisk}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(k)}
-\newpsfontdot{BoldAsterisk}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(K)}
-\newpsfontdotH{SolidAsterisk}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(J)}{(b)}
-%
-\newpsfontdotH{Pentagon}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(p)}{(q)}
-\newpsfontdotH{BoldPentagon}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(P)}{(q)}
-\newpsfontdot{SolidPentagon}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(q)}
-\newpsfontdotH{Hexagon}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(h)}{(G)}
-\newpsfontdotH{BoldHexagon}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(H)}{(G)}
-\newpsfontdot{SolidHexagon}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(G)}
-\newpsfontdotH{Octogon}[1 0 0 1 0 0]{PSTricksDotFont}{(f)}{(g)}
-\newpsfontdotH{BoldOctogon}[1 0 0 1 0 0]{PSTricksDotFont}{(F)}{(g)}
-\newpsfontdot{SolidOctogon}[1 0 0 1 0 0]{PSTricksDotFont}{(g)}
-%
-\newpsfontdot{Bullet}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(b)}
-\newpsfontdotH{Circle}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(c)}{(b)}
-\newpsfontdotH{BoldCircle}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(C)}{(b)}
-%\newpsfontdot{SolidCircle}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(u)}
-\newpsfontdotH{Triangle}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(t)}{(u)}
-\newpsfontdotH{BoldTriangle}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(T)}{(u)}
-\newpsfontdot{SolidTriangle}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(u)}
-\newpsfontdotH{Square}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(s)}{(r)}
-\newpsfontdotH{BoldSquare}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(S)}{(r)}
-\newpsfontdot{SolidSquare}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(r)}
-\newpsfontdot{Add}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(a)}
-\newpsfontdot{BoldAdd}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(A)}
-\newpsfontdot{Mul}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(x)}
-\newpsfontdot{BoldMul}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(X)}
-\newpsfontdotH{Oplus}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(m)}{(b)}
-\newpsfontdotH{BoldOplus}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(M)}{(b)}
-\newpsfontdotH{SolidOplus}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(e)}{(b)}
-\newpsfontdotH{Otimes}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(n)}{(b)}
-\newpsfontdotH{BoldOtimes}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(N)}{(b)}
-\newpsfontdotH{SolidOtimes}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(E)}{(b)}
-\newpsfontdot{Bar}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(i)}
-\newpsfontdot{BoldBar}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(I)}
-\newpsfontdotH{Diamond}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(d)}{(l)}
-\newpsfontdotH{BoldDiamond}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(D)}{(l)}
-\newpsfontdot{SolidDiamond}[1.0 0.0 0.0 1.0 0.0 0.0]{PSTricksDotFont}{(l)}
-
-\ifpstGSfonts
-  \newpsfontdot{oplus}[1.44928 0.0 0.0 1.44928 -0.562319 -0.478261]{StandardSymL}{<C5>}
-  \newpsfontdot{otimes}[1.44928 0.0 0.0 1.44928 -0.562319 -0.475362]{StandardSymL}{<C4>}
-  \newpsfontdot{x}[1.8 0.0 0.0 1.8 -0.495 -0.4788]{StandardSymL}{<B4>}
-  \newpsfontdot{+}[2.3 0.0 0.0 2.3 -0.6486 -0.5819]{NimbusRomNo9L-Regu}{<2B>}
-  \newpsfontdot{asterisk}[2.43309 0.0 0.0 2.43309 -0.609489 -1.14477]{NimbusRomNo9L-Regu}{<2A>}
-  \newpsfontdot{B+}[2.3 0.0 0.0 2.3 -0.6555 -0.5819]{NimbusRomNo9L-Bold}{<2B>}
-  \newpsfontdot{Basterisk}[2.29358 0.0 0.0 2.29358 -0.576835 -1.08486]{NimbusRomNo9L-Bold}{<2A>}
-  \newpsfontdot{|}[1.98413 0.0 0.0 1.38 -0.258929 -0.5]{NimbusSanL-Regu}{(|)}
-  \newpsfontdot{B|}[1.98413 0.0 0.0 1.38 -0.277778 -0.5]{NimbusSanL-Bold}{(|)}%
-\else
-  \newpsfontdot{oplus}[1.44928 0.0 0.0 1.44928 -0.562319 -0.478261]{Symbol}{<C5>}
-  \newpsfontdot{otimes}[1.44928 0.0 0.0 1.44928 -0.562319 -0.475362]{Symbol}{<C4>}
-  \newpsfontdot{x}[1.8 0.0 0.0 1.8 -0.495 -0.4788]{Symbol}{<B4>}
-  \newpsfontdot{+}[2.3 0.0 0.0 2.3 -0.6486 -0.5819]{Times-Roman}{<2B>}
-  \newpsfontdot{asterisk}[2.43309 0.0 0.0 2.43309 -0.609489 -1.14477]{Times-Roman}{<2A>}
-  \newpsfontdot{B+}[2.3 0.0 0.0 2.3 -0.6555 -0.5819]{Times-Bold}{<2B>}
-  \newpsfontdot{Basterisk}[2.29358 0.0 0.0 2.29358 -0.576835 -1.08486]{Times-Bold}{<2A>}
-  \newpsfontdot{|}[1.98413 0.0 0.0 1.38 -0.258929 -0.5]{Helvetica}{(|)}
-  \newpsfontdot{B|}[1.98413 0.0 0.0 1.38 -0.277778 -0.5]{Helvetica-Bold}{(|)}%
-\fi
+%--------------------------- PSTricks dots -----------------------
+\input{pstricks-dots}
+%--------------------------- PSTricks dots end -------------------
 %
 \newdimen\pslinearc
 \define@key[psset]{pstricks}{linearc}[0pt]{\pssetlength\pslinearc{#1}}
@@ -2599,17 +2358,13 @@
 \psset[pstricks]{subgriddiv=5}
 %
 \define@key[psset]{pstricks}{gridfont}[NimbusSanL-Regu]{%
-  \typeout{Test lualatex}%
   \ifPSTlualatex
-    \typeout{Test true}%
     \ifx\relax#1\relax
-       \typeout{>>>>>>>>>>>>>>>> HIER <<<<<<<<<<<<<<}%
        \def\psk@gridfont{\fontid\font\space .findfontid }%
     \else
       \def\psk@gridfont{/#1 findfont }%   hv 2007-11-13
      \fi
   \else
-  \typeout{Test false}%
      \def\psk@gridfont{/#1 findfont }%   hv 2007-11-13
   \fi
 }%
@@ -3864,22 +3619,39 @@ pop
 \pslongbox{Scaleboxto}{\psscaleboxto}
 %
 \def\tx@Rot{Rot }
-\def\psrotateleft{\pst@makebox{\ps@rotateleft\pst@hbox}}
+\def\psrotateleft{%
+  \ifPSTlualatex
+    \def\pst@tempA{-90 }%
+    \def\pst@tempB{90 }%
+  \else
+    \def\pst@tempA{90 }%
+    \def\pst@tempB{-90 }%
+  \fi
+  \pst@makebox{\ps@rotateleft\pst@hbox}}
 \def\ps@rotateleft#1{%
-\leavevmode\hbox{\hskip\ht#1\hskip\dp#1\vbox{\vskip\wd#1%
-\pst@Verb{90 \tx@Rot}
-\vbox to \z@{\vss\hbox to \z@{\box#1\hss}\vskip\z@}%
-\pst@Verb{-90 \tx@Rot}}}}
-\def\psrotateright{\pst@makebox{\ps@rotateright\pst@hbox}}
+  \leavevmode\hbox{\hskip\ht#1\hskip\dp#1\vbox{\vskip\wd#1%
+    \pst@Verb{\pst@tempA \tx@Rot}%
+    \vbox to \z@{\vss\hbox to \z@{\box#1\hss}\vskip\z@}%
+      \pst@Verb{\pst@tempB \tx@Rot}}}}
+%
+\def\psrotateright{%
+  \ifPSTlualatex
+    \def\pst@tempA{90 }%
+    \def\pst@tempB{-90 }%
+  \else
+    \def\pst@tempA{-90 }%
+    \def\pst@tempB{90 }%
+  \fi
+  \pst@makebox{\ps@rotateright\pst@hbox}}
 \def\ps@rotateright#1{%
 % ----------- hv begin 2004-05-07 ----------- patch 15
 %    \hbox{%
   \leavevmode\hbox{%
 % ----------- hv end 2004-05-07 ----------- patch 15
   \hskip\ht#1\hskip\dp#1\vbox{\vskip\wd#1%
-  \pst@Verb{-90 \tx@Rot}
+  \pst@Verb{\pst@tempA \tx@Rot}
   \vbox to \z@{\hbox to \z@{\hss\box#1}\vss}%
-  \pst@Verb{90 \tx@Rot}}}}
+  \pst@Verb{\pst@tempB \tx@Rot}}}}
 \def\psrotatedown{\pst@makebox{\ps@rotatedown\pst@hbox}}
 \def\ps@rotatedown#1{%
 \hbox{\hskip\wd#1\vbox{\vskip\ht#1\vskip\dp#1%
@@ -3983,23 +3755,16 @@ pop
 %\edef\psk@rot{\pst@rotlist \ifx\psk@rot\@empty\else\psk@rot add \fi}}
 \psset[pstricks]{rot=0}
 %
-\def\tx@RotBegin{RotBegin }
-\def\tx@RotEnd{RotEnd }
-\ifPSTlualatex
-  \def\pst@rotate#1#2{%
-    \ifx#1\@empty\else
-        \setbox#2=\hbox{\pst@Verb{#1 \ifPSTlualatex neg \fi\space \tx@RotBegin}\box#2\pst@Verb{\tx@RotEnd}}%
-        % luatex doesn't have the coordinate system of dvips, so we need negative angles
-    \fi
- }%
- \else
-  \def\pst@rotate#1#2{%
-    \ifx#1\@empty\else
-        \setbox#2=\hbox{\pst@Verb{#1 \ifPSTlualatex \fi\space \tx@RotBegin}\box#2\pst@Verb{\tx@RotEnd}}%
-        % luatex doesn't have the coordinate system of dvips, so we need negative angles
-    \fi
+\def\tx@RotBegin{ RotBegin }
+\def\tx@RotEnd{ RotEnd }
+
+\def\pst@rotate#1#2{%
+    \setbox#2=\hbox{\pst@Verb{%  check for empty #1 
+      (#1) /strAngle ED strAngle length 0 eq { 0 }{ #1 } ifelse 
+	 %\ifPSTlualatex neg \fi 
+    \tx@RotBegin}\box#2\pst@Verb{\tx@RotEnd}}%
  }%
- \fi
+
 \def\psput@cartesian#1{%
 \hbox to \z@{\kern\pst@dimg{\vbox to \z@{\vss\box#1\vskip\pst@dimh}\hss}}%
 }
@@ -4039,7 +3804,7 @@ pop
     \use@par
     \if@star\pst@starbox\fi
     \pst@makesmall\pst@hbox
-    \ifx\psk@rot\@empty\else\pst@rotate{ps@rot }\pst@hbox\fi% (MJS)
+    \ifx\psk@rot\@empty\else\pst@rotate{ ps@rot \ifPSTlualatex neg \fi  }\pst@hbox\fi% (MJS)
 %    \pst@rotate\psk@rot\pst@hbox%
     \psput@{#1}\pst@hbox%
   \endgroup
@@ -4197,11 +3962,20 @@ pop
     %\show\pst@coor
   \setbox\pst@hbox=\hbox to\z@{\hss\vbox to\z@{\vss\box\pst@hbox\vss}\hss}%
   \setbox\pst@hbox=\psput@special\pst@hbox
-  \ifnum\pst@C@@rType=7
-    \ifx\psk@rot\@empty\else\pst@rotate{ps@rot }\pst@hbox\fi% CHANGED FROM \psk@rot (MJS)
+  \ifPSTlualatex
+    \ifnum\pst@C@@rType=7
+      \ifx\psk@rot\@empty\else\pst@rotate{ps@rot neg}\pst@hbox\fi% CHANGED FROM \psk@rot (MJS)
+    \else
+      \ifx\psk@rot\@empty\else\pst@rotate{\psk@rot\space neg}\pst@hbox\fi% 
+    \fi
   \else
-    \ifx\psk@rot\@empty\else\pst@rotate{\psk@rot}\pst@hbox\fi% 
-  \fi}
+    \ifnum\pst@C@@rType=7
+      \ifx\psk@rot\@empty\else\pst@rotate{ps@rot }\pst@hbox\fi% CHANGED FROM \psk@rot (MJS)
+    \else
+      \ifx\psk@rot\@empty\else\pst@rotate{\psk@rot}\pst@hbox\fi% 
+    \fi
+  \fi
+}
 %
 %
 \def\uput@viii#1#2{%
-- 
cgit v1.2.3

