From 5f11fef1e86695714c1eca5a17d5fc78176ecb2d Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de>
Date: Fri, 17 Mar 2017 15:18:12 +0100
Subject: [PATCH] unify PS code layout

---
 pub/share/wups17a.ps | 147 ++++++++++++++++++-------------------------
 1 file changed, 62 insertions(+), 85 deletions(-)

diff --git a/pub/share/wups17a.ps b/pub/share/wups17a.ps
index becd8629..f60e5d00 100644
--- a/pub/share/wups17a.ps
+++ b/pub/share/wups17a.ps
@@ -67,8 +67,7 @@ WuGdict17a begin
 /pol2xy{ 2 copy cos mul 3 1 roll sin mul } def % r phi | x y
 
 /eexp { 2.71828 x exp } def % "exp" is x^y, eexp is e^x
-/tanh { 2.71828 x 2 copy exp 3 1 roll neg exp
-        2 copy sub 3 1 roll add div } def
+/tanh { 2.71828 x 2 copy exp 3 1 roll neg exp 2 copy sub 3 1 roll add div } def
 
 
 %%  Page layout and global figure size:
@@ -83,7 +82,6 @@ WuGdict17a begin
    cm x cm x translate } bind def
 /originUpperLeft_A4{ .7 28.3 cmtranslate } bind def
 /goffsetA4 { ungscale originUpperLeft_A4 gscale } def
-/EdgeLeftDIN{ originUpperLeft_A4 } bind def % OBSOLETE since 17a
 
 % set absolute global scale and relative symbol size
 /defsiz { % size(cm) symbolsize(rel) | -
@@ -93,10 +91,10 @@ WuGdict17a begin
    } def
 /gscale {
    gsiz dup scale
-} def
+   } def
 /ungscale {
    1 gsiz div dup scale
-} def
+   } def
 
 % symbol (and label?) size as sublinear function of figure size
 /autolabel { % size(cm) | symbolsize(rel)
@@ -415,11 +413,11 @@ WuGdict17a begin
 /Helvetica-BoldOblique /MyFont-BoldOblique ISOLatin1Encoding ReEncode
 
 /setPalatino {
-/Palatino             /MyFont             ISOLatin1Encoding ReEncode
-/Palatino-Italic      /MyFont-Oblique     ISOLatin1Encoding ReEncode
-/Palatino-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
-/Palatino-BoldItalic  /MyFont-BoldOblique ISOLatin1Encoding ReEncode
-} def
+   /Palatino             /MyFont             ISOLatin1Encoding ReEncode
+   /Palatino-Italic      /MyFont-Oblique     ISOLatin1Encoding ReEncode
+   /Palatino-Bold        /MyFont-Bold        ISOLatin1Encoding ReEncode
+   /Palatino-BoldItalic  /MyFont-BoldOblique ISOLatin1Encoding ReEncode
+   } def
 
 %% Preset standard styles:
 
@@ -677,31 +675,31 @@ WuGdict17a begin
 /iFrame 0 def
 
 /setnewpage { % xoff yoff
-  /yoffnewpage x def
-  /xoffnewpage x def
+   /yoffnewpage x def
+   /xoffnewpage x def
 } def
 /newpage {
-  goffsetA4
-  xoffnewpage yoffnewpage offset
+   goffsetA4
+   xoffnewpage yoffnewpage offset
 } def
 /setpagegrid { % ncol nrow xoffnewframe yoffnewframe
-  /yoffnewframe x def
-  /xoffnewframe x def
-  /nrowpage x def
-  /ncolpage x def
+   /yoffnewframe x def
+   /xoffnewframe x def
+   /nrowpage x def
+   /ncolpage x def
 } def
 /nextFrame {
-  /iFrame iFrame 1 add def
-  iFrame nrowpage ncolpage mul mod 0 eq {
-    showpage gscale newpage
-  } {
-    iFrame ncolpage mod 0 eq {
-      xoffnewframe ncolpage 1 sub neg mul yoffnewframe offset
-    } {
-      xoffnewframe 0 offset
-    } ifelse
-  } ifelse
-} def
+   /iFrame iFrame 1 add def
+   iFrame nrowpage ncolpage mul mod 0 eq {
+     showpage gscale newpage
+     } {
+     iFrame ncolpage mod 0 eq {
+       xoffnewframe ncolpage 1 sub neg mul yoffnewframe offset
+     } {
+       xoffnewframe 0 offset
+       } ifelse
+     } ifelse
+   } def
 
 
 /zValues { pop pop } def
@@ -765,12 +763,6 @@ WuGdict17a begin
    /xTacLen tAng cos xyTacLen mul def /yTacLen tAng sin xyTacLen mul def
    /xAng aAng cos def /yAng aAng sin def
    /aMean aFro aTo add 2 div def
-   /aArr false def
-   } def
-/ArrAxx { % label <args of OneAxx> | - : axis with arrow
-   OneAxx
-   /aLab x def
-   /aArr true def
    } def
 
 % draw axis (with parameters preset by OneAxx or ArrAxx)
@@ -783,24 +775,6 @@ WuGdict17a begin
       % draw a line
       aFro 0 np mv
       aTo  0 li st
-      % draw an arrow and a label, if requested
-      aArr {
-         gsave
-            aTo 0 offset
-            aAng neg rotate
-            mmunscale
-            aAng rotate
-            0 0 0 .3 pfeilspitze % draw an arrow
-            .3 0 offset
-            aAng neg rotate
-            setlab
-            aAng 45 le
-               { 0 -.8 xNumHeightL sub aLab textRT }
-               { 0  .2 aLab textCB }
-               ifelse
-           grestore
-         } if
-      grestore
    } def
 
 % draw ticks (positions given by SetTicVec, parameters preset by OneAxx/..)
@@ -890,9 +864,10 @@ WuGdict17a begin
 /Num { % Generic but useless. Adjust for your application.
    setnum
    fontheight ymm div yDisRel mul tAng sin mul /yDist x def
-   { dup textW xDisRel mul tAng cos mul /xDist x def
-     xPos aPos xAng mul add xDist sub
-     yPos aPos yAng mul add yDist sub 3 2 roll textCM } TacExe
+   {  dup textW xDisRel mul tAng cos mul /xDist x def
+      xPos aPos xAng mul add xDist sub
+      yPos aPos yAng mul add yDist sub 3 2 roll textCM
+      } TacExe
    } def
 /setnumDisRel { % xDisRel yDisRel | - : adjust just a little bit
    /yDisRel x def /xDisRel x def
@@ -901,15 +876,17 @@ WuGdict17a begin
 % explicit Num routines for rectangular case
 /xNumL { % : numbers on low x axis
    setnum
-   { fontheight ymm div % conversion -> user_scale
-     dup /xNumHeightL x def
-     -.6 mul yPos add aPos x 3 2 roll textCT } TacExe
+   {  fontheight ymm div % conversion -> user_scale
+      dup /xNumHeightL x def
+      -.6 mul yPos add aPos x 3 2 roll textCT
+      } TacExe
    } def
 /xNumH { % : numbers on high x axis
    setnum
-   { fontheight ymm div % conversion -> user_scale
-     dup /xNumHeightH x def
-     .6 mul yPos add aPos x 3 2 roll textCB } TacExe
+   {  fontheight ymm div % conversion -> user_scale
+      dup /xNumHeightH x def
+      .6 mul yPos add aPos x 3 2 roll textCB
+      } TacExe
    } def
 /yNumL { % : numbers on low y axis
    setnum
@@ -1559,20 +1536,20 @@ WuGdict17a begin
    } def
 /pfeil_arcn { % x_cent y_cent radius ang_from ang_to siz
    gsave
-     6 -2 roll offset
-     4 copy pop 0 0 5 2 roll
-     np arcn st
-     % radius ang_from ang_to siz
-     4 1 roll
-     gsave
-       rotate
-       pop
-       % siz radius
-       0 -90 4 3 roll
-       pfeilspitze
-       grestore
-     grestore
-} def
+      6 -2 roll offset
+      4 copy pop 0 0 5 2 roll
+      np arcn st
+      % radius ang_from ang_to siz
+      4 1 roll
+      gsave
+         rotate
+         pop
+         % siz radius
+         0 -90 4 3 roll
+         pfeilspitze
+         grestore
+      grestore
+   } def
 
 /knautschy { % x0 y0 y_knau y_tot knautschy - : insert an S in dived y-axis
    % the total height of the generated object is y_tot
@@ -1595,15 +1572,15 @@ WuGdict17a begin
    } def
 
 /bemasz { % x y L ang text | - %% precede by '24 setown 1 [] lset /pfeilangle 90 def'
-    gsave
-    5 3 roll offset % consumes x and y
-    x rotate % consumes ang | L text
-    dup textw .5 mul fontheight .4 mul add /bmszDT x def % => half text width
-    0 0 3 2 roll textCM % L
-    .5 mul /bmszDX x def % => half bemasz length
-    bmszDX     0   0 fontheight .67 mul bmszDX bmszDT sub Pfeil
-    bmszDX neg 0 180 fontheight .67 mul bmszDX bmszDT sub Pfeil
-    grestore
+   gsave
+   5 3 roll offset % consumes x and y
+   x rotate % consumes ang | L text
+   dup textw .5 mul fontheight .4 mul add /bmszDT x def % => half text width
+   0 0 3 2 roll textCM % L
+   .5 mul /bmszDX x def % => half bemasz length
+   bmszDX     0   0 fontheight .67 mul bmszDX bmszDT sub Pfeil
+   bmszDX neg 0 180 fontheight .67 mul bmszDX bmszDT sub Pfeil
+   grestore
    } def
 
 
-- 
GitLab