[latex3-commits] [git/LaTeX3-latex3-latex3] dvips-colorants: Support DeviceN colorants for dvips: (c6351dcf6)

Marcel Fabian Krüger tex at 2krueger.de
Fri Oct 15 14:51:14 CEST 2021


Repository : https://github.com/latex3/latex3
On branch  : dvips-colorants
Link       : https://github.com/latex3/latex3/commit/c6351dcf6264c4ea6bb9bdeb17a4abff03a2987a

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

commit c6351dcf6264c4ea6bb9bdeb17a4abff03a2987a
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Fri Oct 15 14:51:14 2021 +0200

    Support DeviceN colorants for dvips:


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

c6351dcf6264c4ea6bb9bdeb17a4abff03a2987a
 l3backend/l3backend-color.dtx | 94 +++++++++++++++++++++++++++----------------
 1 file changed, 59 insertions(+), 35 deletions(-)

diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index 38ed4c854..d15690cdc 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -486,6 +486,55 @@
 % backend.
 %
 %    \begin{macrocode}
+%<*dvipdfmx|luatex|pdftex|xetex|dvips>
+%    \end{macrocode}
+%
+% But we start with some functionality needed for both PostScript and
+% PDF based backends.
+%
+% \begin{variable}{\g_@@_backend_colorant_prop}
+%    \begin{macrocode}
+\prop_new:N \g_@@_backend_colorant_prop
+%    \end{macrocode}
+% \end{variable}
+%
+% \begin{macro}[EXP]{\@@_backend_devicen_colorants:n}
+% \begin{macro}[EXP]{\@@_backend_devicen_colorants:w}
+%    \begin{macrocode}
+\cs_new:Npx \@@_backend_devicen_colorants:n #1
+  {
+    \exp_not:N \tl_if_blank:nF {#1}
+      {
+        \c_space_tl
+        << ~
+          /Colorants ~
+            << ~
+              \exp_not:N \@@_backend_devicen_colorants:w #1 ~
+                \exp_not:N \q_recursion_tail \c_space_tl
+                \exp_not:N \q_recursion_stop
+            >> ~
+        >>
+      }
+  }
+\cs_new:Npn \@@_backend_devicen_colorants:w #1 ~
+  {
+    \quark_if_recursion_tail_stop:n {#1}
+    \prop_if_in:NnT \g_@@_backend_colorant_prop {#1}
+      {
+        #1 ~
+        \prop_item:Nn \g_@@_backend_colorant_prop {#1} ~
+      }
+    \@@_backend_devicen_colorants:w
+  }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%    \begin{macrocode}
+%</dvipdfmx|luatex|pdftex|xetex|dvips>
+%    \end{macrocode}
+%
+%    \begin{macrocode}
 %<*dvips>
 %    \end{macrocode}
 %
@@ -535,6 +584,15 @@
               { \exp_not:N \int_use:N \g_@@_model_int }
               {#1} {#2} {#3} {#4} {#5}
           }
+        \prop_gput:Nxx \exp_not:N \g_@@_backend_colorant_prop
+          { / \exp_not:N \str_convert_pdfname:n {#1} }
+          {
+            << ~
+              /setcolorspace ~ {} ~
+            >> ~ begin ~
+              color \exp_not:N \int_use:N \g_@@_model_int \c_space_tl
+            end
+          }
       }
   }
 \cs_generate_variant:Nn \@@_backend_separation_init:nnnnn { nxx }
@@ -740,6 +798,7 @@
               [ ~ #1 ~ ] ~
               #2 ~
               { ~ #3 ~ } ~
+              \@@_backend_devicen_colorants:n {#1}
             ] ~ setcolorspace
           } ~ def ~
         end
@@ -792,12 +851,6 @@
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{variable}{\g_@@_backend_colorant_prop}
-%    \begin{macrocode}
-\prop_new:N \g_@@_backend_colorant_prop
-%    \end{macrocode}
-% \end{variable}
-%
 % \begin{macro}{\@@_backend_separation_init:nnnnn}
 % \begin{macro}{\@@_backend_separation_init:nn}
 % \begin{macro}{\@@_backend_separation_init_CIELAB:nnn}
@@ -871,8 +924,6 @@
 %
 % \begin{macro}{\@@_backend_devicen_init:nnn}
 % \begin{macro}[EXP]{\@@_backend_devicen_init:w}
-% \begin{macro}[EXP]{\@@_backend_devicen_colorants:n}
-% \begin{macro}[EXP]{\@@_backend_devicen_colorants:w}
 %   Similar to the Separations case, but with an arbitrary function for
 %   the alternative space work.
 %    \begin{macrocode}
@@ -927,36 +978,9 @@
     \tl_if_blank:nF {#2}
       { \@@_backend_devicen_init:w #2 \s_@@_stop }
   }
-\cs_new:Npx \@@_backend_devicen_colorants:n #1
-  {
-    \exp_not:N \tl_if_blank:nF {#1}
-      {
-        \c_space_tl
-        << ~
-          /Colorants ~
-            << ~
-              \exp_not:N \@@_backend_devicen_colorants:w #1 ~
-                \exp_not:N \q_recursion_tail \c_space_tl
-                \exp_not:N \q_recursion_stop
-            >> ~
-        >>
-      }
-  }
-\cs_new:Npn \@@_backend_devicen_colorants:w #1 ~
-  {
-    \quark_if_recursion_tail_stop:n {#1}
-    \prop_if_in:NnT \g_@@_backend_colorant_prop {#1}
-      {
-        #1 ~
-        \prop_item:Nn \g_@@_backend_colorant_prop {#1} ~
-      }
-    \@@_backend_devicen_colorants:w
-  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
-% \end{macro}
-% \end{macro}
 %
 %    \begin{macrocode}
 %</dvipdfmx|luatex|pdftex|xetex>





More information about the latex3-commits mailing list.