[latex3-commits] [git/LaTeX3-latex3-latex3] main: Move common code to l3color (b9c5d3056)

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Apr 19 18:38:49 CEST 2022


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/b9c5d3056bd61935891e30b4a28bc0a0555dfa89

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

commit b9c5d3056bd61935891e30b4a28bc0a0555dfa89
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Apr 19 17:37:28 2022 +0100

    Move common code to l3color


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

b9c5d3056bd61935891e30b4a28bc0a0555dfa89
 l3backend/CHANGELOG.md                  |  1 +
 l3backend/l3backend-color.dtx           | 34 +++++++++++++++++++++++++++------
 l3kernel/CHANGELOG.md                   |  3 +++
 l3kernel/l3color.dtx                    |  5 ++++-
 l3kernel/testfiles/m3expl001.luatex.tlg |  2 ++
 l3kernel/testfiles/m3expl001.ptex.tlg   |  2 ++
 l3kernel/testfiles/m3expl001.tlg        |  2 ++
 l3kernel/testfiles/m3expl001.uptex.tlg  |  2 ++
 l3kernel/testfiles/m3expl001.xetex.tlg  |  2 ++
 l3kernel/testfiles/m3expl003.luatex.tlg |  2 ++
 l3kernel/testfiles/m3expl003.ptex.tlg   |  2 ++
 l3kernel/testfiles/m3expl003.tlg        |  2 ++
 l3kernel/testfiles/m3expl003.uptex.tlg  |  2 ++
 l3kernel/testfiles/m3expl003.xetex.tlg  |  2 ++
 14 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/l3backend/CHANGELOG.md b/l3backend/CHANGELOG.md
index 39feab65a..19be80b5e 100644
--- a/l3backend/CHANGELOG.md
+++ b/l3backend/CHANGELOG.md
@@ -9,6 +9,7 @@ this project uses date-based 'snapshot' version identifiers.
 ### Changed
 - Adjust `(x)dvipdfmx` backend approach to color following issues with
   multiple color stacks in `xetex.def`
+- Move some functions to `l3color`
 
 ## [2022-04-14]
 
diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index 7de59def3..384af0484 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -1064,19 +1064,24 @@
   {
     \__kernel_backend_literal:x
       { pdf : bc ~ fill ~ \pdf_object_ref:n {#1} ~ [ #2 ] }
-    \group_insert_after:N \@@_backend_reset:
   }
 \cs_new_protected:Npn \@@_backend_stroke_separation:nn #1#2
   {
     \__kernel_backend_literal:x
       { pdf : bc ~ stroke ~ \pdf_object_ref:n {#1} ~ [ #2 ] }
-    \group_insert_after:N \@@_backend_reset:
   }
 \cs_new_eq:NN \@@_backend_fill_devicen:nn \@@_backend_fill_separation:nn
 \cs_new_eq:NN \@@_backend_stroke_devicen:nn \@@_backend_stroke_separation:nn
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_backend_fill_reset:, \@@_backend_stroke_reset:}
+%    \begin{macrocode}
+\cs_new_eq:NN \@@_backend_fill_reset: \@@_backend_reset:
+\cs_new_eq:NN \@@_backend_stroke_reset: \@@_backend_reset:
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</dvipdfmx|xetex>
 %    \end{macrocode}
@@ -1113,7 +1118,6 @@
     \tl_set:Nn \l_@@_backend_fill_tl {#1}
     \__kernel_color_backend_stack_push:nn \l_@@_backend_stack_int
       { #1 ~ \l_@@_backend_stroke_tl }
-    \group_insert_after:N \@@_backend_reset:
   }
 \cs_new_protected:Npn \@@_backend_stroke_cmyk:n #1
   { \@@_backend_stroke:n { #1 ~ K } }
@@ -1126,7 +1130,6 @@
     \tl_set:Nn \l_@@_backend_stroke_tl {#1}
     \__kernel_color_backend_stack_push:nn \l_@@_backend_stack_int
       { \l_@@_backend_fill_tl \c_space_tl #1 }
-    \group_insert_after:N \@@_backend_reset:
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1148,6 +1151,13 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_backend_fill_reset:, \@@_backend_stroke_reset:}
+%    \begin{macrocode}
+\cs_new_eq:NN \@@_backend_fill_reset: \@@_backend_reset:
+\cs_new_eq:NN \@@_backend_stroke_reset: \@@_backend_reset:
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</luatex|pdftex>
 %    \end{macrocode}
@@ -1178,7 +1188,6 @@
 \cs_new_protected:Npn \@@_backend_fill:n #1
   {
     \__kernel_backend_literal:n { color~push~ #1 }
-    \group_insert_after:N \@@_backend_reset:
   }
 \cs_new_protected:Npn \@@_backend_stroke_cmyk:n #1
   { \__kernel_backend_postscript:n { /color.sc { #1 ~ setcmykcolor } def } }
@@ -1206,6 +1215,13 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_backend_fill_reset:, \@@_backend_stroke_reset:}
+%    \begin{macrocode}
+\cs_new_eq:NN \@@_backend_fill_reset: \@@_backend_reset:
+\cs_new_protected:Npn \@@_backend_stroke_reset: { }
+%    \end{macrocode}
+% \end{macro}
+%
 %    \begin{macrocode}
 %</dvips>
 %    \end{macrocode}
@@ -1233,7 +1249,6 @@
 \cs_new_protected:Npn \@@_backend_fill:n #1
   {
     \__kernel_backend_literal:n { color~push~ #1 }
-    \group_insert_after:N \@@_backend_reset:
   }
 %    \end{macrocode}
 % \end{macro}
@@ -1323,6 +1338,13 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\@@_backend_fill_reset:, \@@_backend_stroke_reset:}
+%    \begin{macrocode}
+\cs_new_eq:NN \@@_backend_fill_reset: \@@_backend_reset:
+\cs_new_protected:Npn \@@_backend_stroke_reset: { }
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\@@_backend_devicen_init:nnn, \@@_backend_iccbased_init:nnn}
 %   No support at present.
 %    \begin{macrocode}
diff --git a/l3kernel/CHANGELOG.md b/l3kernel/CHANGELOG.md
index 81af951ce..537300bec 100644
--- a/l3kernel/CHANGELOG.md
+++ b/l3kernel/CHANGELOG.md
@@ -7,6 +7,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+### Changed
+- Collect some common code from `l3backend-color`
+
 ## [2022-04-10]
 
 ### Added
diff --git a/l3kernel/l3color.dtx b/l3kernel/l3color.dtx
index 93f42374e..1ce89ae15 100644
--- a/l3kernel/l3color.dtx
+++ b/l3kernel/l3color.dtx
@@ -1600,7 +1600,10 @@
     \exp_after:wN \@@_draw:nnn \l_@@_current_tl { stroke }
   }
 \cs_new_protected:Npn \@@_draw:nnn #1#2#3
-  { \use:c { @@_backend_ #3 _ #1 :n } {#2} }
+  {
+    \use:c { @@_backend_ #3 _ #1 :n } {#2}
+    \exp_args:Nc \group_insert_after:N { @@_backend_ #3 _ reset: }
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 1166bd352..4e5e2c3bc 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -67,6 +67,8 @@ Defining \__color_backend_fill_separation:nn on line ...
 Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__color_backend_fill_devicen:nn on line ...
 Defining \__color_backend_stroke_devicen:nn on line ...
+Defining \__color_backend_fill_reset: on line ...
+Defining \__color_backend_stroke_reset: on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 01594ea34..6ab1891cc 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -71,6 +71,8 @@ Defining \__color_backend_fill_separation:nn on line ...
 Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__color_backend_fill_devicen:nn on line ...
 Defining \__color_backend_stroke_devicen:nn on line ...
+Defining \__color_backend_fill_reset: on line ...
+Defining \__color_backend_stroke_reset: on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 3b759e4de..e3a358a96 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -67,6 +67,8 @@ Defining \__color_backend_fill_separation:nn on line ...
 Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__color_backend_fill_devicen:nn on line ...
 Defining \__color_backend_stroke_devicen:nn on line ...
+Defining \__color_backend_fill_reset: on line ...
+Defining \__color_backend_stroke_reset: on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 01594ea34..6ab1891cc 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -71,6 +71,8 @@ Defining \__color_backend_fill_separation:nn on line ...
 Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__color_backend_fill_devicen:nn on line ...
 Defining \__color_backend_stroke_devicen:nn on line ...
+Defining \__color_backend_fill_reset: on line ...
+Defining \__color_backend_stroke_reset: on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 6f720f643..2f978f81d 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -60,6 +60,8 @@ Defining \__color_backend_fill_separation:nn on line ...
 Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__color_backend_fill_devicen:nn on line ...
 Defining \__color_backend_stroke_devicen:nn on line ...
+Defining \__color_backend_fill_reset: on line ...
+Defining \__color_backend_stroke_reset: on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 1166bd352..4e5e2c3bc 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -67,6 +67,8 @@ Defining \__color_backend_fill_separation:nn on line ...
 Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__color_backend_fill_devicen:nn on line ...
 Defining \__color_backend_stroke_devicen:nn on line ...
+Defining \__color_backend_fill_reset: on line ...
+Defining \__color_backend_stroke_reset: on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 01594ea34..6ab1891cc 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -71,6 +71,8 @@ Defining \__color_backend_fill_separation:nn on line ...
 Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__color_backend_fill_devicen:nn on line ...
 Defining \__color_backend_stroke_devicen:nn on line ...
+Defining \__color_backend_fill_reset: on line ...
+Defining \__color_backend_stroke_reset: on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 3b759e4de..e3a358a96 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -67,6 +67,8 @@ Defining \__color_backend_fill_separation:nn on line ...
 Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__color_backend_fill_devicen:nn on line ...
 Defining \__color_backend_stroke_devicen:nn on line ...
+Defining \__color_backend_fill_reset: on line ...
+Defining \__color_backend_stroke_reset: on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 01594ea34..6ab1891cc 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -71,6 +71,8 @@ Defining \__color_backend_fill_separation:nn on line ...
 Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__color_backend_fill_devicen:nn on line ...
 Defining \__color_backend_stroke_devicen:nn on line ...
+Defining \__color_backend_fill_reset: on line ...
+Defining \__color_backend_stroke_reset: on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 6f720f643..2f978f81d 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -60,6 +60,8 @@ Defining \__color_backend_fill_separation:nn on line ...
 Defining \__color_backend_stroke_separation:nn on line ...
 Defining \__color_backend_fill_devicen:nn on line ...
 Defining \__color_backend_stroke_devicen:nn on line ...
+Defining \__color_backend_fill_reset: on line ...
+Defining \__color_backend_stroke_reset: on line ...
 Defining \__box_backend_clip:N on line ...
 Defining \__box_backend_rotate:Nn on line ...
 Defining \__box_backend_rotate_aux:Nn on line ...





More information about the latex3-commits mailing list.