From fa4840ca74917d6402885b9b77c26e51b61fc68a Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Fri, 19 Jun 2020 03:03:14 +0000
Subject: CTAN sync 202006190303

---
 macros/latex/contrib/l3backend/l3backend-draw.dtx | 190 +++++++---------------
 1 file changed, 59 insertions(+), 131 deletions(-)

(limited to 'macros/latex/contrib/l3backend/l3backend-draw.dtx')

diff --git a/macros/latex/contrib/l3backend/l3backend-draw.dtx b/macros/latex/contrib/l3backend/l3backend-draw.dtx
index 6b235e4faa..6c82820a90 100644
--- a/macros/latex/contrib/l3backend/l3backend-draw.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-draw.dtx
@@ -43,7 +43,7 @@
 %    }^^A
 % }
 %
-% \date{Released 2020-06-03}
+% \date{Released 2020-06-18}
 %
 % \maketitle
 %
@@ -313,7 +313,7 @@
       { \dim_to_decimal_in_bp:n {#1} ~ setlinewidth }
   }
 \cs_new_protected:Npn \@@_backend_miterlimit:n #1
-  { \@@_backend_literal:x { \fp_eval:n {#1} ~ setmiterlimit } }
+  { \@@_backend_literal:n { #1 ~ setmiterlimit } }
 \cs_new_protected:Npn \@@_backend_cap_butt:
   { \@@_backend_literal:n { 0 ~ setlinecap } }
 \cs_new_protected:Npn \@@_backend_cap_round:
@@ -335,8 +335,8 @@
 %
 % \begin{macro}
 %   {
-%     \@@_backend_color_fill_cmyk:nnnn   ,
-%     \@@_backend_color_stroke_cmyk:nnnn
+%     \@@_backend_color_fill_cmyk:n   ,
+%     \@@_backend_color_stroke_cmyk:n
 %   }
 % \begin{macro}
 %   {
@@ -345,63 +345,37 @@
 %   }
 % \begin{macro}
 %   {
-%     \@@_backend_color_fill_rgb:nnn   ,
-%     \@@_backend_color_stroke_rgb:nnn
-%   }
-% \begin{macro}
-%   {
-%     \@@_backend_color_fill:n, \@@_backend_color_fill:x,
-%     \@@_backend_color_stroke:n, \@@_backend_color_stroke:x
+%     \@@_backend_color_fill_rgb:n   ,
+%     \@@_backend_color_stroke_rgb:n
 %   }
+% \begin{macro}{\@@_backend_color_fill:n, \@@_backend_color_stroke:n}
 %   For \texttt{dvips}, we can use the standard color stack to deal with
 %   stroke color, but for fills have to switch to raw PostScript. This is
 %   thus not handled by the stack, but the context is very restricted. See
 %   also how fills are implemented.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_color_fill_cmyk:nnnn #1#2#3#4
-  {
-    \@@_backend_color_fill:x
-      {
-        \fp_eval:n {#1} ~ \fp_eval:n {#2} ~
-        \fp_eval:n {#3} ~ \fp_eval:n {#4} ~
-        setcmykcolor
-      }
-  }
-\cs_new_protected:Npn \@@_backend_color_stroke_cmyk:nnnn #1#2#3#4
-  {
-    \@@_backend_color_stroke:x
-      {
-        cmyk ~
-        \fp_eval:n {#1} ~ \fp_eval:n {#2} ~
-        \fp_eval:n {#3} ~ \fp_eval:n {#4}
-      }
-  }
-\cs_new_protected:Npn \@@_backend_color_fill_gray:n #1
-  { \@@_backend_color_fill:x { \fp_eval:n {#1} ~ setgray } }
+\cs_new_protected:Npn \@@_backend_color_fill_cmyk:n #1
+  { \@@_backend_color_fill:n { #1 ~ setcmykcolor } }
+\cs_new_protected:Npn \@@_backend_color_stroke_cmyk:n #1
+  { \@@_backend_color_stroke:n { cmyk ~ #1 } }
 \cs_new_protected:Npn \@@_backend_color_stroke_gray:n #1
-  { \@@_backend_color_stroke:x { gray ~ \fp_eval:n {#1} } }
-\cs_new_protected:Npn \@@_backend_color_fill_rgb:nnn #1#2#3
-  {
-    \@@_backend_color_fill:x
-      { \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ setrgbcolor }
-  }
-\cs_new_protected:Npn \@@_backend_color_stroke_rgb:nnn #1#2#3
-  {
-    \@@_backend_color_stroke:x
-      { rgb ~ \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} }
-  }
+  { \@@_backend_color_fill:n { #1 ~ setgray } }
+\cs_new_protected:Npn \@@_backend_color_fill_gray:n #1
+  { \@@_backend_color_stroke:n { gray ~ #1 } }
+\cs_new_protected:Npn \@@_backend_color_fill_rgb:n #1
+  { \@@_backend_color_fill:n { #1 ~ setrgbcolor } }
+\cs_new_protected:Npn \@@_backend_color_stroke_rgb:n #1
+  { \@@_backend_color_stroke:n { rgb ~ #1 } }
 \cs_new_protected:Npn \@@_backend_color_fill:n #1
   { 
     \__kernel_backend_postscript:n
       { /color.fc ~ { #1 } ~ def }
   }
-\cs_generate_variant:Nn \@@_backend_color_fill:n { x }
 \cs_new_protected:Npn \@@_backend_color_stroke:n #1
   {
     \__kernel_backend_literal:n { color~push~#1 } 
     \group_insert_after:N \@@_color_reset:
   }
-\cs_generate_variant:Nn \@@_backend_color_stroke:n { x }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
@@ -418,14 +392,7 @@
 \cs_new_protected:Npn \@@_backend_cm:nnnn #1#2#3#4
   {
     \@@_backend_literal:n
-      {
-        [
-          \fp_eval:n {#1} ~ \fp_eval:n {#2} ~
-          \fp_eval:n {#3} ~ \fp_eval:n {#4} ~
-          0 ~ 0
-        ] ~
-        concat
-      }
+      { [ #1 ~ #2 ~ #3 ~ #4 ~ 0 ~ 0 ] ~ concat }
   }
 %    \end{macrocode}
 % \end{macro}
@@ -633,7 +600,7 @@
       { \dim_to_decimal_in_bp:n {#1} ~ w }
   }
 \cs_new_protected:Npn \@@_backend_miterlimit:n #1
-  { \@@_backend_literal:x { \fp_eval:n {#1} ~ M } }
+  { \@@_backend_literal:x { #1 ~ M } }
 \cs_new_protected:Npn \@@_backend_cap_butt:
   { \@@_backend_literal:n { 0 ~ J } }
 \cs_new_protected:Npn \@@_backend_cap_round:
@@ -655,8 +622,8 @@
 %
 % \begin{macro}
 %   {
-%     \@@_backend_color_fill_cmyk:nnnn   ,
-%     \@@_backend_color_stroke_cmyk:nnnn
+%     \@@_backend_color_fill_cmyk:n   ,
+%     \@@_backend_color_stroke_cmyk:n
 %   }
 % \begin{macro}
 %   {
@@ -665,46 +632,26 @@
 %   }
 % \begin{macro}
 %   {
-%     \@@_backend_color_fill_rgb:nnn   ,
-%     \@@_backend_color_stroke_rgb:nnn
+%     \@@_backend_color_fill_rgb:n   ,
+%     \@@_backend_color_stroke_rgb:n
 %   }
 % \begin{macro}{\@@_backend_color_select:n, \@@_backend_color_select:x}
 % \begin{macro}{\@@_backend_color_reset:}
 %    Color has to be split between \texttt{(x)dvipdfmx} and the PDF engines
 %    as there is no color stack for fill/stroke separation in the former.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_color_fill_cmyk:nnnn #1#2#3#4
-  {
-    \@@_backend_color_select:x
-      {
-        \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ 
-        \fp_eval:n {#3} ~ \fp_eval:n {#4} ~
-        k
-      }
-  }
-\cs_new_protected:Npn \@@_backend_color_stroke_cmyk:nnnn #1#2#3#4
-  {
-    \@@_backend_color_select:x
-      {
-        \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ 
-        \fp_eval:n {#3} ~ \fp_eval:n {#4} ~
-        k
-      }
-  }
+\cs_new_protected:Npn \@@_backend_color_fill_cmyk:n #1
+  { \@@_backend_color_select:n { #1 ~ k } }
+\cs_new_protected:Npn \@@_backend_color_stroke_cmyk:n #1
+  { \@@_backend_color_select:n { #1 ~ K } }
 \cs_new_protected:Npn \@@_backend_color_fill_gray:n #1
-  { \@@_backend_color_select:x { \fp_eval:n {#1} ~ g } }
+  { \@@_backend_color_select:n { #1 ~ g } }
 \cs_new_protected:Npn \@@_backend_color_stroke_gray:n #1
-  { \@@_backend_color_select:x { \fp_eval:n {#1} ~ G } }
-\cs_new_protected:Npn \@@_backend_color_fill_rgb:nnn #1#2#3
-  {
-    \@@_backend_color_select:x
-      { \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ rg }
-  }
-\cs_new_protected:Npn \@@_backend_color_stroke_rgb:nnn #1#2#3
-  {
-    \@@_backend_color_select:x
-      { \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ RG }
-  }
+  { \@@_backend_color_select:n { #1 ~ G } }
+\cs_new_protected:Npn \@@_backend_color_fill_rgb:n #1
+  { \@@_backend_color_select:n { #1 ~ rg } }
+\cs_new_protected:Npn \@@_backend_color_stroke_rgb:n #1
+  { \@@_backend_color_select:n { #1 ~ RG } }
 %<*pdfmode>
 \cs_new_protected:Npx \@@_backend_color_select:n #1
   {
@@ -746,11 +693,7 @@
 \cs_new_protected:Npn \@@_backend_cm:nnnn #1#2#3#4
   {
 %<*pdfmode>
-    \__kernel_backend_matrix:x
-      {
-        \fp_eval:n {#1} ~ \fp_eval:n {#2} ~
-        \fp_eval:n {#3} ~ \fp_eval:n {#4}
-      }
+    \__kernel_backend_matrix:n { #1 ~ #2 ~ #3 ~ #4 }
 %</pdfmode>
 %<*dvipdfmx|xdvipdfmx>
     \@@_backend_cm_decompose:nnnnN {#1} {#2} {#3} {#4}
@@ -904,13 +847,8 @@
     \@@_backend_cm:nnnn {#2} {#3} {#4} {#5}
 %</pdfmode>
 %<*dvipdfmx|xdvipdfmx>
-    \__kernel_backend_literal:x
-      {
-        pdf:btrans~matrix~
-        \fp_eval:n {#2} ~ \fp_eval:n {#3} ~
-        \fp_eval:n {#4} ~ \fp_eval:n {#5} ~
-        0 ~ 0
-      }
+    \__kernel_backend_literal:n
+      { pdf:btrans~matrix~ #2 ~ #3 ~ #4 ~ #5 ~ 0 ~ 0 }
 %</dvipdfmx|xdvipdfmx>
     \hbox_overlap_right:n { \box_use:N #1 }
 %<*dvipdfmx|xdvipdfmx>
@@ -1199,7 +1137,7 @@
 \cs_new_protected:Npn \@@_backend_linewidth:n #1
   { \@@_backend_scope:x { stroke-width=" \dim_to_decimal:n {#1} " } }
 \cs_new_protected:Npn \@@_backend_miterlimit:n #1
-  { \@@_backend_scope:x { stroke-miterlimit=" \fp_eval:n {#1} " } }
+  { \@@_backend_scope:x { stroke-miterlimit=" #1 " } }
 \cs_new_protected:Npn \@@_backend_cap_butt:
   { \@@_backend_scope:n { stroke-linecap="butt" } }
 \cs_new_protected:Npn \@@_backend_cap_round:
@@ -1222,43 +1160,41 @@
 %
 % \begin{macro}
 %   {
-%     \@@_backend_color_fill_cmyk:nnnn   ,
-%     \@@_backend_color_stroke_cmyk:nnnn
+%     \@@_backend_color_fill_cmyk:n   ,
+%     \@@_backend_color_stroke_cmyk:n
 %   }
+% \begin{macro}{\@@_backend_color_fill_cmyk:w}
 % \begin{macro}
 %   {
 %     \@@_backend_color_fill_gray:n   ,
 %     \@@_backend_color_stroke_gray:n
 %   }
+% \begin{macro}{\@@_backend_color_gray_aux:n}
 % \begin{macro}
 %   {
-%     \@@_backend_color_fill_rgb:nnn   ,
-%     \@@_backend_color_stroke_rgb:nnn
+%     \@@_backend_color_fill_rgb:n   ,
+%     \@@_backend_color_stroke_rgb:n
 %   }
 % \begin{macro}{\@@_backend_color_fill:nnn}
 %  SVG fill color has to be covered outside of the stack, as for
 %  \texttt{dvips}. Here, we are only allowed RGB colors so there is some
 %  conversion to do.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_color_fill_cmyk:nnnn #1#2#3#4
+\cs_new_protected:Npn \@@_backend_color_fill_cmyk:n #1
+  { \@@_backend_color_fill_cmyk:w #1 \s_@@_stop }
+\cs_new_protected:Npn \@@_backend_color_fill_cmyk:w
+  #1 ~ #2 ~ #3 ~ #4 \s_@@_stop
   {
     \use:x
       {
         \@@_backend_color_fill:nnn
-          { \fp_eval:n { -100 * ( (#1) * ( 1 - (#4) ) - 1 ) } }
-          { \fp_eval:n { -100 * ( (#2) * ( 1 - (#4) ) + #4 - 1 ) } }
-          { \fp_eval:n { -100 * ( (#3) * ( 1 - (#4) ) + #4 - 1 ) } }
-      }
-  }
-\cs_new_protected:Npn \@@_backend_color_stroke_cmyk:nnnn #1#2#3#4
-  {
-    \@@_backend_select:x
-      {
-        cmyk~
-        \fp_eval:n {#1} ~ \fp_eval:n {#2} ~
-        \fp_eval:n {#3} ~ \fp_eval:n {#4}
+          { \fp_eval:n { -100 * ( 1 - min ( 1 , #1 + #4 ) ) } }
+          { \fp_eval:n { -100 * ( 1 - min ( 1 , #2 + #4 ) ) } }
+          { \fp_eval:n { -100 * ( 1 - min ( 1 , #3 + #4 ) ) } }
       }
   }
+\cs_new_protected:Npn \@@_backend_color_stroke_cmyk:n #1
+  { \@@_backend_select:n { cmyk ~ #1 } }
 \cs_new_protected:Npn \@@_backend_color_fill_gray:n #1
   {
     \use:x
@@ -1271,7 +1207,7 @@
   { \@@_backend_color_fill:nnn {#1} {#1} {#1} }
 \cs_new_protected:Npn \@@_backend_color_stroke_gray:n #1
   { \@@_backend_select:x { gray~ \fp_eval:n {#1} } }
-\cs_new_protected:Npn \@@_backend_color_fill_rgb:nnn #1#2#3
+\cs_new_protected:Npn \@@_backend_color_fill_rgb:n #1
   {
     \use:x
       {
@@ -1296,16 +1232,15 @@
          "
       }
   }
-\cs_new_protected:Npn \@@_backend_color_stroke_rgb:nnn #1#2#3
-  {
-    \@@_backend_select:x
-      { rgb~ \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} }
-  }
+\cs_new_protected:Npn \@@_backend_color_stroke_rgb:n #1
+  { \@@_backend_select:n { rgb ~ #1 } }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\@@_backend_cm:nnnn}
 %   The four arguments here are floats (the affine matrix), the last
@@ -1316,14 +1251,7 @@
     \@@_backend_scope:n
       {
        transform =
-         "
-           matrix
-             (
-               \fp_eval:n {#1} , \fp_eval:n {#2} ,
-               \fp_eval:n {#3} , \fp_eval:n {#4} ,
-               0pt , 0pt
-             )
-         "
+         " matrix ( #1 , #2 , #3 , #4 , 0pt , 0pt ) "
       }
   }
 %    \end{macrocode}
-- 
cgit v1.2.3

