[latex3-commits] [git/LaTeX3-latex3-latex3] master: Enable opacity with dvips (f30cd5ab9)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Jan 24 18:11:06 CET 2021


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

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

commit f30cd5ab914b0ecbe3cf3c04ec87a20b9072e957
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Jan 20 15:19:07 2021 +0000

    Enable opacity with dvips


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

f30cd5ab914b0ecbe3cf3c04ec87a20b9072e957
 l3backend/l3backend-opacity.dtx        | 15 ++++++++++++---
 l3kernel/testfiles/m3expl001.ptex.tlg  |  1 +
 l3kernel/testfiles/m3expl001.uptex.tlg |  1 +
 l3kernel/testfiles/m3expl003.ptex.tlg  |  1 +
 l3kernel/testfiles/m3expl003.uptex.tlg |  1 +
 5 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/l3backend/l3backend-opacity.dtx b/l3backend/l3backend-opacity.dtx
index 23087941d..ec867d2da 100644
--- a/l3backend/l3backend-opacity.dtx
+++ b/l3backend/l3backend-opacity.dtx
@@ -71,10 +71,19 @@
 %<*dvips>
 %    \end{macrocode}
 %
-% \begin{macro}{\@@_backend_select:n}
-%   No stack support.
+% \begin{macro}{\@@_backend_select:n,\@@_backend_select_aux:n}
+%   No stack so set values directly.
 %    \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_select:n #1 { }
+\cs_new_protected:Npn \@@_backend_select:n #1
+  {
+    \exp_args:Nx \@@_backend_select_aux:n
+      { \fp_eval:n { min(max(0,#1),1) } }
+  }
+\cs_new_protected:Npn \@@_backend_select_aux:n #1
+  {
+    \__kernel_backend_postscript:n
+      { #1 ~ .setfillconstantalpha ~ #1 ~ .setstrokeconstantalpha }
+  }
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 8ca7e978e..0a2a1b572 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -168,6 +168,7 @@ Defining \__pdf_backend_version_minor: on line ...
 Defining \__pdf_backend_bdc:nn on line ...
 Defining \__pdf_backend_emc: on line ...
 Defining \__opacity_backend_select:n on line ...
+Defining \__opacity_backend_select_aux:n on line ...
 Defining \__opacity_backend_fill:n on line ...
 Defining \__opacity_backend_stroke:n on line ...
 Defining \__opacity_backend:nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 8ca7e978e..0a2a1b572 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -168,6 +168,7 @@ Defining \__pdf_backend_version_minor: on line ...
 Defining \__pdf_backend_bdc:nn on line ...
 Defining \__pdf_backend_emc: on line ...
 Defining \__opacity_backend_select:n on line ...
+Defining \__opacity_backend_select_aux:n on line ...
 Defining \__opacity_backend_fill:n on line ...
 Defining \__opacity_backend_stroke:n on line ...
 Defining \__opacity_backend:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 8ca7e978e..0a2a1b572 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -168,6 +168,7 @@ Defining \__pdf_backend_version_minor: on line ...
 Defining \__pdf_backend_bdc:nn on line ...
 Defining \__pdf_backend_emc: on line ...
 Defining \__opacity_backend_select:n on line ...
+Defining \__opacity_backend_select_aux:n on line ...
 Defining \__opacity_backend_fill:n on line ...
 Defining \__opacity_backend_stroke:n on line ...
 Defining \__opacity_backend:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 8ca7e978e..0a2a1b572 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -168,6 +168,7 @@ Defining \__pdf_backend_version_minor: on line ...
 Defining \__pdf_backend_bdc:nn on line ...
 Defining \__pdf_backend_emc: on line ...
 Defining \__opacity_backend_select:n on line ...
+Defining \__opacity_backend_select_aux:n on line ...
 Defining \__opacity_backend_fill:n on line ...
 Defining \__opacity_backend_stroke:n on line ...
 Defining \__opacity_backend:nn on line ...





More information about the latex3-commits mailing list.