[latex3-commits] [l3svn] 03/03: Partial support for page colours

noreply at latex-project.org noreply at latex-project.org
Wed Oct 25 08:34:22 CEST 2017


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

commit 7f0fa0da0e1c7410d2cc5b5999ff89ee4792cfef
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Oct 25 07:33:03 2017 +0100

    Partial support for page colours
    
    This deals with DVI mode and the case where color or graphics are loaded
    in PDF mode. As the latter requires messing about with \shipout, a
    separate commit will cover PDF mode with no LaTeX2e code loaded.
---
 l3kernel/l3drivers.dtx                  |   47 +++++++++++++++++++++++++++++++
 l3kernel/testfiles/m3expl001.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl001.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl001.tlg        |    1 +
 l3kernel/testfiles/m3expl001.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl001.xetex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.luatex.tlg |    1 +
 l3kernel/testfiles/m3expl003.ptex.tlg   |    1 +
 l3kernel/testfiles/m3expl003.tlg        |    1 +
 l3kernel/testfiles/m3expl003.uptex.tlg  |    1 +
 l3kernel/testfiles/m3expl003.xetex.tlg  |    1 +
 11 files changed, 57 insertions(+)

diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index a5c1271..2b41af8 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -135,6 +135,15 @@
 %   while preserving the color used in the box.
 % \end{function}
 %
+% \begin{function}[added = 2017-10-24]
+%   {\__driver_color_page:}
+%   \begin{syntax}
+%     \cs{__driver_color_page:}
+%   \end{syntax}
+%   Sets the page color to that specified by \cs{l__color_page_tl}, or clears
+%   the page color if this variable is empty.
+% \end{function}
+%
 % \section{Drawing}
 %
 % The drawing functions provided here are \emph{highly} experimental. They
@@ -586,6 +595,22 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\@@_page_color:}
+%   Simple application of color support at the driver level.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_page_color:
+  {
+    \tex_special:D
+      {
+        background ~
+        \tl_if_empty:NTF \g__color_page_tl
+          { " newpath~clip }
+          { \g__color_page_tl }
+      }
+  }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</dvisvgm|dvipdfmx|dvips|xdvipdfmx>
 %    \end{macrocode}
@@ -721,6 +746,28 @@
 % \end{macro}
 % \end{macro}
 %
+% \begin{macro}{\@@_page_color:}
+%   Direct PDF output doesn't natively support page color, requiring instead
+%   a box to the size of the page.  At present, the code is a no-op unless
+%   \pkg{color} has been loaded.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_page_color: { }
+%<*package>
+\AtBeginDocument
+  {
+    \cs_if_exist:NT \set at page@color
+      {
+       \cs_set_protected:Npn \@@_page_color:
+         {
+           \tl_set_eq:NN \current at page@color \g__color_page_tl
+           \set at page@color
+         }
+      }
+  }
+%</package>
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</pdfmode>
 %    \end{macrocode}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 714670d..80e26f6 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -5758,6 +5758,7 @@ Defining \__driver_color_convert_cmyk:w on line ...
 Defining \__driver_color_convert_rgb:w on line ...
 Defining \__driver_color_convert_spot:w on line ...
 Defining \__driver_color_reset: on line ...
+Defining \__driver_page_color: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 00e4cbd..26a0f07 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -5745,6 +5745,7 @@ Defining \__driver_convert_model:w on line ...
 Defining \__driver_color_convert_spot: on line ...
 Defining \__driver_color_convert_spot:w on line ...
 Defining \__driver_color_reset: on line ...
+Defining \__driver_page_color: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 6509dde..05e32ce 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -5950,6 +5950,7 @@ Defining \__driver_color_convert_cmyk:w on line ...
 Defining \__driver_color_convert_rgb:w on line ...
 Defining \__driver_color_convert_spot:w on line ...
 Defining \__driver_color_reset: on line ...
+Defining \__driver_page_color: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 9c0e0ae..2e21a09 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -5944,6 +5944,7 @@ Defining \__driver_convert_model:w on line ...
 Defining \__driver_color_convert_spot: on line ...
 Defining \__driver_color_convert_spot:w on line ...
 Defining \__driver_color_reset: on line ...
+Defining \__driver_page_color: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 73eab16..b83cc01 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -5728,6 +5728,7 @@ Defining \__driver_convert_model:w on line ...
 Defining \__driver_color_convert_spot: on line ...
 Defining \__driver_color_convert_spot:w on line ...
 Defining \__driver_color_reset: on line ...
+Defining \__driver_page_color: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 714670d..80e26f6 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -5758,6 +5758,7 @@ Defining \__driver_color_convert_cmyk:w on line ...
 Defining \__driver_color_convert_rgb:w on line ...
 Defining \__driver_color_convert_spot:w on line ...
 Defining \__driver_color_reset: on line ...
+Defining \__driver_page_color: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 00e4cbd..26a0f07 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -5745,6 +5745,7 @@ Defining \__driver_convert_model:w on line ...
 Defining \__driver_color_convert_spot: on line ...
 Defining \__driver_color_convert_spot:w on line ...
 Defining \__driver_color_reset: on line ...
+Defining \__driver_page_color: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 6509dde..05e32ce 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -5950,6 +5950,7 @@ Defining \__driver_color_convert_cmyk:w on line ...
 Defining \__driver_color_convert_rgb:w on line ...
 Defining \__driver_color_convert_spot:w on line ...
 Defining \__driver_color_reset: on line ...
+Defining \__driver_page_color: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 9c0e0ae..2e21a09 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -5944,6 +5944,7 @@ Defining \__driver_convert_model:w on line ...
 Defining \__driver_color_convert_spot: on line ...
 Defining \__driver_color_convert_spot:w on line ...
 Defining \__driver_color_reset: on line ...
+Defining \__driver_page_color: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 73eab16..b83cc01 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -5728,6 +5728,7 @@ Defining \__driver_convert_model:w on line ...
 Defining \__driver_color_convert_spot: on line ...
 Defining \__driver_color_convert_spot:w on line ...
 Defining \__driver_color_reset: on line ...
+Defining \__driver_page_color: on line ...
 Defining \__driver_literal:n on line ...
 Defining \__driver_scope_begin: on line ...
 Defining \__driver_scope_end: on line ...

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list