[latex3-commits] [git/LaTeX3-latex3-latex3] main: (x)dvipdfmx can handle stroke color on a stack (741b8f9d5)
Joseph Wright
joseph.wright at morningstar2.co.uk
Tue Apr 19 18:21:13 CEST 2022
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/741b8f9d5c9e1b744dd51ede5576ebc8aed5b5f3
>---------------------------------------------------------------
commit 741b8f9d5c9e1b744dd51ede5576ebc8aed5b5f3
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue Apr 19 17:15:44 2022 +0100
(x)dvipdfmx can handle stroke color on a stack
>---------------------------------------------------------------
741b8f9d5c9e1b744dd51ede5576ebc8aed5b5f3
l3backend/l3backend-color.dtx | 38 +++++++++++++---------
.../l3draw/testfiles/m3draw004.xetex.tlg | 12 +++----
.../l3draw/testfiles/m3draw007.xetex.tlg | 10 +++---
l3kernel/testfiles/m3expl001.xetex.tlg | 3 +-
l3kernel/testfiles/m3expl003.xetex.tlg | 3 +-
5 files changed, 37 insertions(+), 29 deletions(-)
diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index 3f58de2c5..e432a00a8 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -367,8 +367,7 @@
% \@@_backend_select_rgb:n
% }
% \begin{macro}{\@@_backend_reset:}
-% Using the single stack is relatively easy as there is only one route:
-% notice though that we can only deal with stroke color here (see below).
+% Using the single stack is relatively easy as there is only one route.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_select:n #1
{ \__kernel_backend_literal:n { pdf : bc ~ [ #1 ] } }
@@ -1030,26 +1029,26 @@
%
% \begin{macro}
% {
+% \@@_backend_fill:n ,
% \@@_backend_fill_cmyk:n ,
% \@@_backend_fill_gray:n ,
% \@@_backend_fill_rgb:n ,
-% \@@_backend_fill:n ,
+% \@@_backend_stroke:n ,
% \@@_backend_stroke_cmyk:n ,
% \@@_backend_stroke_gray:n ,
% \@@_backend_stroke_rgb:n
% }
% \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_fill_cmyk:n #1
- { \@@_backend_fill:n { #1 ~ k } }
-\cs_new_protected:Npn \@@_backend_fill_gray:n #1
- { \@@_backend_fill:n { #1 ~ g } }
-\cs_new_protected:Npn \@@_backend_fill_rgb:n #1
- { \@@_backend_fill:n { #1 ~ rg } }
\cs_new_protected:Npn \@@_backend_fill:n #1
- { \__kernel_backend_literal:n {#1} }
-\cs_new_eq:NN \@@_backend_stroke_cmyk:n \@@_backend_select:n
-\cs_new_eq:NN \@@_backend_stroke_gray:n \@@_backend_r:n
-\cs_new_eq:NN \@@_backend_stroke_rgb:n \@@_backend_select:n
+ { \__kernel_backend_literal:n { pdf : bc ~ fill ~ [ #1 ] } }
+\cs_new_eq:NN \@@_backend_fill_cmyk:n \@@_backend_fill:n
+\cs_new_eq:NN \@@_backend_fill_gray:n \@@_backend_fill:n
+\cs_new_eq:NN \@@_backend_fill_rgb:n \@@_backend_fill:n
+\cs_new_protected:Npn \@@_backend_stroke:n #1
+ { \__kernel_backend_literal:n { pdf : bc ~ stroke ~ [ #1 ] } }
+\cs_new_eq:NN \@@_backend_stroke_cmyk:n \@@_backend_stroke:n
+\cs_new_eq:NN \@@_backend_stroke_gray:n \@@_backend_stroke:n
+\cs_new_eq:NN \@@_backend_stroke_rgb:n \@@_backend_stroke:n
% \end{macrocode}
% \end{macro}
%
@@ -1060,10 +1059,17 @@
% \@@_backend_fill_devicen:nn,
% \@@_backend_stroke_devicen:nn
% }
-% No fill color until we can sort out stacks properly.
% \begin{macrocode}
-\cs_new_eq:NN \@@_backend_fill_separation:nn \@@_backend_select_separation:nn
-\cs_new_protected:Npn \@@_backend_stroke_separation:nn #1#2 { }
+\cs_new_protected:Npn \@@_backend_fill_separation:nn #1#2
+ {
+ \__kernel_backend_literal:x
+ { pdf : bc ~ fill ~ \pdf_object_ref:n {#1} ~ [ #2 ] }
+ }
+\cs_new_protected:Npn \@@_backend_stroke_separation:nn #1#2
+ {
+ \__kernel_backend_literal:x
+ { pdf : bc ~ stroke ~ \pdf_object_ref:n {#1} ~ [ #2 ] }
+ }
\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}
diff --git a/l3experimental/l3draw/testfiles/m3draw004.xetex.tlg b/l3experimental/l3draw/testfiles/m3draw004.xetex.tlg
index b72835439..d6690a991 100644
--- a/l3experimental/l3draw/testfiles/m3draw004.xetex.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw004.xetex.tlg
@@ -443,13 +443,13 @@ TEST 8: \color_fill:n
...\special{pdf:literal 10 M}
...\special{pdf:literal [] 0 d}
...\hbox(0.0+0.0)x0.0
-....\special{1.0 0.0 0.0 rg}
+....\special{pdf:bc fill [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 28.34647 28.34647 re}
....\special{pdf:literal f}
-....\special{1.0 0.0 0.0 rg}
+....\special{pdf:bc fill [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 28.34647 28.34647 re}
....\special{pdf:literal B}
-....\special{1.0 0.0 0.0 rg}
+....\special{pdf:bc fill [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 m}
....\special{pdf:literal 28.34647 283.46457 l}
....\special{pdf:literal 56.69292 0 l}
@@ -476,13 +476,13 @@ TEST 9: \color_stroke:n
...\special{pdf:literal 10 M}
...\special{pdf:literal [] 0 d}
...\hbox(0.0+0.0)x0.0
-....\special{pdf:bc [1.0 0.0 0.0]}
+....\special{pdf:bc stroke [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 28.34647 28.34647 re}
....\special{pdf:literal f}
-....\special{pdf:bc [1.0 0.0 0.0]}
+....\special{pdf:bc stroke [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 28.34647 28.34647 re}
....\special{pdf:literal B}
-....\special{pdf:bc [1.0 0.0 0.0]}
+....\special{pdf:bc stroke [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 m}
....\special{pdf:literal 28.34647 283.46457 l}
....\special{pdf:literal 56.69292 0 l}
diff --git a/l3experimental/l3draw/testfiles/m3draw007.xetex.tlg b/l3experimental/l3draw/testfiles/m3draw007.xetex.tlg
index a9cb336f8..6ec2ff527 100644
--- a/l3experimental/l3draw/testfiles/m3draw007.xetex.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw007.xetex.tlg
@@ -16,7 +16,7 @@ TEST 1: stroke
...\special{pdf:literal 10 M}
...\special{pdf:literal [] 0 d}
...\hbox(0.0+0.0)x0.0
-....\special{1.0 0.0 0.0 rg}
+....\special{pdf:bc fill [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 m}
....\special{pdf:literal 0 113.38582 l}
....\special{pdf:literal 113.38582 113.38582 l}
@@ -45,7 +45,7 @@ TEST 2: fill
...\special{pdf:literal 10 M}
...\special{pdf:literal [] 0 d}
...\hbox(0.0+0.0)x0.0
-....\special{1.0 0.0 0.0 rg}
+....\special{pdf:bc fill [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 m}
....\special{pdf:literal 0 113.38582 l}
....\special{pdf:literal 113.38582 113.38582 l}
@@ -74,7 +74,7 @@ TEST 3: draw
...\special{pdf:literal 10 M}
...\special{pdf:literal [] 0 d}
...\hbox(0.0+0.0)x0.0
-....\special{1.0 0.0 0.0 rg}
+....\special{pdf:bc fill [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 m}
....\special{pdf:literal 0 113.38582 l}
....\special{pdf:literal 113.38582 113.38582 l}
@@ -103,7 +103,7 @@ TEST 4: fill,stroke
...\special{pdf:literal 10 M}
...\special{pdf:literal [] 0 d}
...\hbox(0.0+0.0)x0.0
-....\special{1.0 0.0 0.0 rg}
+....\special{pdf:bc fill [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 m}
....\special{pdf:literal 0 113.38582 l}
....\special{pdf:literal 113.38582 113.38582 l}
@@ -138,7 +138,7 @@ TEST 5: clip;fill
....\special{pdf:literal h}
....\special{pdf:literal W}
....\special{pdf:literal n}
-....\special{1.0 0.0 0.0 rg}
+....\special{pdf:bc fill [1.0 0.0 0.0]}
....\special{pdf:literal 0 0 m}
....\special{pdf:literal 0 113.38582 l}
....\special{pdf:literal 113.38582 113.38582 l}
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 8c7d3f37a..6f720f643 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -48,10 +48,11 @@ Defining \__color_backend_devicen_init:nnn on line ...
Defining \__color_backend_devicen_init:w on line ...
Defining \__color_backend_iccbased_init:nnn on line ...
Defining \__color_backend_iccbased_device:nnn on line ...
+Defining \__color_backend_fill:n on line ...
Defining \__color_backend_fill_cmyk:n on line ...
Defining \__color_backend_fill_gray:n on line ...
Defining \__color_backend_fill_rgb:n on line ...
-Defining \__color_backend_fill:n on line ...
+Defining \__color_backend_stroke:n on line ...
Defining \__color_backend_stroke_cmyk:n on line ...
Defining \__color_backend_stroke_gray:n on line ...
Defining \__color_backend_stroke_rgb:n on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 8c7d3f37a..6f720f643 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -48,10 +48,11 @@ Defining \__color_backend_devicen_init:nnn on line ...
Defining \__color_backend_devicen_init:w on line ...
Defining \__color_backend_iccbased_init:nnn on line ...
Defining \__color_backend_iccbased_device:nnn on line ...
+Defining \__color_backend_fill:n on line ...
Defining \__color_backend_fill_cmyk:n on line ...
Defining \__color_backend_fill_gray:n on line ...
Defining \__color_backend_fill_rgb:n on line ...
-Defining \__color_backend_fill:n on line ...
+Defining \__color_backend_stroke:n on line ...
Defining \__color_backend_stroke_cmyk:n on line ...
Defining \__color_backend_stroke_gray:n on line ...
Defining \__color_backend_stroke_rgb:n on line ...
More information about the latex3-commits
mailing list.