Skip to content

Commit

Permalink
Explicitly expand fill/stroke values in backend
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
josephwright committed Feb 17, 2023
1 parent 5fe87a2 commit a2c8d3b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions l3backend/l3backend-color.dtx
Expand Up @@ -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{}.
Expand All @@ -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>
Expand Down Expand Up @@ -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 } }
Expand All @@ -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}
Expand Down

0 comments on commit a2c8d3b

Please sign in to comment.