[latex3-commits] [git/LaTeX3-latex3-latex3] luacolor: Explicitly expand fill/stroke values in backend (a2c8d3bc2)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Feb 17 12:08:15 CET 2023


Repository : https://github.com/latex3/latex3
On branch  : luacolor
Link       : https://github.com/latex3/latex3/commit/a2c8d3bc2af3ee359d5f71160d8a8886b0abbc61

>---------------------------------------------------------------

commit a2c8d3bc2af3ee359d5f71160d8a8886b0abbc61
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Feb 17 11:08:15 2023 +0000

    Explicitly expand fill/stroke values in backend
    
    This is needed with a Lua approach as the vars
    are otherwise based verbatim.
    Forcing expansion here is likely clearer than relying
    on work at the Lua step.


>---------------------------------------------------------------

a2c8d3bc2af3ee359d5f71160d8a8886b0abbc61
 l3backend/l3backend-color.dtx | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index 4bf77d347..9c3354bfe 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -301,6 +301,12 @@
 % \begin{macro}{\@@_backend_select:nn}
 % \begin{macro}{\@@_backend_reset:}
 % \begin{macro}{\@@_backend_stack_push:nn}
+% \begin{macro}
+%   {
+%     \@@_backend_stack_push:nnn ,
+%     \@@_backend_stack_push:nVn ,
+%     \@@_backend_stack_push:nnV
+%   }
 %   Store the values then pass to the stack. The abstraction here allows for
 %   transparency needing the same fundamental approach but with switchable
 %   code for \LuaTeX{}.
@@ -320,11 +326,15 @@
 \cs_new_protected:Npn \@@_backend_reset:
   { \__kernel_color_backend_stack_pop:n \l_@@_backend_stack_int }
 \cs_new_eq:NN \@@_backend_stack_push:nn \__kernel_color_backend_stack_push:nn
+\cs_new_protected:Npn \@@_backend_stack_push:nnn #1#2#3
+  { \@@_backend_stack_push:nn {#1} { #2 ~ #3 } }
+\cs_generate_variant:Nn \@@_backend_stack_push:nnn { nV , nnV }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
 % \end{macro}
 % \end{macro}
+% \end{macro}
 %
 %    \begin{macrocode}
 %</luatex|pdftex>
@@ -1101,8 +1111,8 @@
 \cs_new_protected:Npn \@@_backend_fill:n #1
   {
     \tl_set:Nn \l_@@_backend_fill_tl {#1}
-    \@@_backend_stack_push:nn \l_@@_backend_stack_int
-      { #1 ~ \l_@@_backend_stroke_tl }
+    \@@_backend_stack_push:nnV \l_@@_backend_stack_int
+      {#1} \l_@@_backend_stroke_tl
   }
 \cs_new_protected:Npn \@@_backend_stroke_cmyk:n #1
   { \@@_backend_stroke:n { #1 ~ K } }
@@ -1113,8 +1123,8 @@
 \cs_new_protected:Npn \@@_backend_stroke:n #1
   {
     \tl_set:Nn \l_@@_backend_stroke_tl {#1}
-    \@@_backend_stack_push:nn \l_@@_backend_stack_int
-      { \l_@@_backend_fill_tl \c_space_tl #1 }
+    \@@_backend_stack_push:nVn \l_@@_backend_stack_int
+      \l_@@_backend_fill_tl {#1}
   }
 %    \end{macrocode}
 % \end{macro}





More information about the latex3-commits mailing list.