[latex3-commits] [git/LaTeX3-latex3-latex3] master: Enable separation colors in dvipdfmx (2bf5dc396)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Aug 28 08:00:32 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/2bf5dc396fafe78c834f909816dba64d78c4b993

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

commit 2bf5dc396fafe78c834f909816dba64d78c4b993
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Aug 28 07:00:32 2020 +0100

    Enable separation colors in dvipdfmx


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

2bf5dc396fafe78c834f909816dba64d78c4b993
 l3backend/l3backend-color.dtx           | 63 ++++++++++++++++-----------------
 l3kernel/testfiles/m3expl001.luatex.tlg |  1 +
 l3kernel/testfiles/m3expl001.tlg        |  1 +
 l3kernel/testfiles/m3expl001.xetex.tlg  |  1 +
 l3kernel/testfiles/m3expl003.luatex.tlg |  1 +
 l3kernel/testfiles/m3expl003.tlg        |  1 +
 l3kernel/testfiles/m3expl003.xetex.tlg  |  1 +
 7 files changed, 37 insertions(+), 32 deletions(-)

diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index 3f9f4fb94..4869caf8d 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -299,33 +299,6 @@
 % backend.
 %
 %    \begin{macrocode}
-%<*dvipdmx|xdvipdfmx>
-%    \end{macrocode}
-%
-% \begin{macro}{\@@_backend_select_separation:nn}
-%   No support at present.
-%    \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_select_separation:nn #1#2 { }
-%    \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}
-%   {\@@_backend_separation_init:nnnnn, \@@_backend_separation_init_cielab:nnnnn}
-% \begin{macro}{\@@_backend_separation_init_cielab:n}
-%   No support at present.
-%    \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_separation_init:nnnnn #1#2#3#4#5 { }
-\cs_new_protected:Npn \@@_backend_separation_init_cielab:nnnnn #1#2#3#4#5 { }
-\cs_new_protected:Npn \@@_backend_separation_init_cielab:n #1 { }
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-%    \begin{macrocode}
-%</dvipdmx|xdvipdfmx>
-%    \end{macrocode}
-%
-%    \begin{macrocode}
 %<*dvips>
 %    \end{macrocode}
 %
@@ -423,26 +396,35 @@
 %    \end{macrocode}
 %
 %    \begin{macrocode}
-%<*pdfmode>
+%<*dvipdfmx|pdfmode|xdvipdfmx>
 %    \end{macrocode}
 %
 % \begin{macro}{\@@_backend_select_separation:nn}
+%   Different syntaxes here as the stacks are accessed very differently.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_backend_select_separation:nn #1#2
+%<*dvipdfmx|xdvipdfmx>
+  { \@@_backend_select:n { @#1 ~ [#2] } }
+%</dvipdfmx|xdvipdfmx>
+%<*pdfmode>
   { \@@_backend_select:n { /#1 ~ cs ~ /#1 ~ CS ~ #2 ~ scn ~ #2 ~ SCN } }
+%</pdfmode>
 %    \end{macrocode}
 % \end{macro}
 %
-% \begin{macro}
-%   {\@@_backend_separation_init:nnnnn, \@@_backend_separation_init_cielab:nnnnn}
+% \begin{macro}{\@@_backend_separation_init:nnnnn}
+% \begin{macro}{\@@_backend_separation_init:n}
+% \begin{macro}{\@@_backend_separation_init_cielab:nnnnn}
 % \begin{macro}{\@@_backend_separation_init_cielab:n}
 %   Initialising the PDF structures needs two parts: creating an object
 %   containing the \enquote{real} name of the Separation, then adding a reference
 %   to that to each page. The latter uses the internal name of the \texttt{cs}.
+%   For \texttt{(x)dvipdfmx}, the backend does most of the work so we need a
+%   simplified version.
 %    \begin{macrocode}
 \cs_new_protected:Npn \@@_backend_separation_init:nnnnn #1#2#3#4#5
   {
-    \pdf_object_now:nx { array }
+    \@@_backend_separation_init:n
       {
         /Separation
         / \str_convert_pdfname:n {#1} ~ #2 ~
@@ -454,6 +436,7 @@
           /C1 ~ [#5] /N ~ 1
         >>
       }
+%<*pdfmode>
     \use:x
       {
         \pdfcoredict_gput:nnn
@@ -461,9 +444,23 @@
           { color \int_use:N \g_@@_separation_int }
           { \pdf_object_last: }
       }
+%</pdfmode>
   }
 \cs_if_exist:NF \pdf_object_now:nn
   { \cs_gset_protected:Npn \@@_backend_separation_init:nnnnn #1#2#3#4#5 { } }
+\cs_new_protected:Npn \@@_backend_separation_init:n #1
+  {
+%<*dvipdfmx|xdvipdfmx>
+    \__kernel_backend_literal:x
+      {
+        pdf:obj ~ @ color \int_use:N \g_@@_separation_int \c_space_tl
+          [#1]
+      }
+%</dvipdfmx|xdvipdfmx>
+%<*pdfmode>
+    \pdf_object_now:nx { array } {#1}
+%</pdfmode>  
+  }
 %    \end{macrocode}
 %   For CIELAB colors, we need one object per document for the illuminant,
 %   plus initialisation of the color space referencing that object.
@@ -497,9 +494,11 @@
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
 %
 %    \begin{macrocode}
-%</pdfmode>
+%</dvipdfmx|pdfmode|xdvipdfmx>
 %    \end{macrocode}
 %
 % \subsection{Fill and stroke color}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 76d8226a5..e894ac81d 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -37,6 +37,7 @@ Defining \__color_backend_select:n on line ...
 Defining \__color_backend_reset: on line ...
 Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
+Defining \__color_backend_separation_init:n on line ...
 Defining \__color_backend_separation_init_cielab:nnnnn on line ...
 Defining \__color_backend_separation_init_cielab:n on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 76d8226a5..e894ac81d 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -37,6 +37,7 @@ Defining \__color_backend_select:n on line ...
 Defining \__color_backend_reset: on line ...
 Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
+Defining \__color_backend_separation_init:n on line ...
 Defining \__color_backend_separation_init_cielab:nnnnn on line ...
 Defining \__color_backend_separation_init_cielab:n on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index ff455f7a1..1f25430e3 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -32,6 +32,7 @@ Defining \__color_backend_reset: on line ...
 Defining \__color_backend_pickup:N on line ...
 Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
+Defining \__color_backend_separation_init:n on line ...
 Defining \__color_backend_separation_init_cielab:nnnnn on line ...
 Defining \__color_backend_separation_init_cielab:n on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 76d8226a5..e894ac81d 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -37,6 +37,7 @@ Defining \__color_backend_select:n on line ...
 Defining \__color_backend_reset: on line ...
 Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
+Defining \__color_backend_separation_init:n on line ...
 Defining \__color_backend_separation_init_cielab:nnnnn on line ...
 Defining \__color_backend_separation_init_cielab:n on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 76d8226a5..e894ac81d 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -37,6 +37,7 @@ Defining \__color_backend_select:n on line ...
 Defining \__color_backend_reset: on line ...
 Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
+Defining \__color_backend_separation_init:n on line ...
 Defining \__color_backend_separation_init_cielab:nnnnn on line ...
 Defining \__color_backend_separation_init_cielab:n on line ...
 Defining \__color_backend_fill_cmyk:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index ff455f7a1..1f25430e3 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -32,6 +32,7 @@ Defining \__color_backend_reset: on line ...
 Defining \__color_backend_pickup:N on line ...
 Defining \__color_backend_select_separation:nn on line ...
 Defining \__color_backend_separation_init:nnnnn on line ...
+Defining \__color_backend_separation_init:n on line ...
 Defining \__color_backend_separation_init_cielab:nnnnn on line ...
 Defining \__color_backend_separation_init_cielab:n on line ...
 Defining \__color_backend_fill_cmyk:n on line ...





More information about the latex3-commits mailing list.