[latex3-commits] [git/LaTeX3-latex3-latex2e] master: Update l3backend to 2021-01-29 (f8215014)

Joseph Wright joseph.wright at morningstar2.co.uk
Fri Jan 29 10:44:22 CET 2021


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

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

commit f8215014c89f031949c3053c019e71225b39910e
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Fri Jan 29 09:44:22 2021 +0000

    Update l3backend to 2021-01-29


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

f8215014c89f031949c3053c019e71225b39910e
 texmf/tex/latex/l3backend/l3backend-dvipdfmx.def | 140 ++++++++++++++++-------
 texmf/tex/latex/l3backend/l3backend-dvips.def    |  72 +++++++-----
 texmf/tex/latex/l3backend/l3backend-dvisvgm.def  |  12 +-
 texmf/tex/latex/l3backend/l3backend-luatex.def   |  66 +++++++----
 texmf/tex/latex/l3backend/l3backend-pdftex.def   |  66 +++++++----
 texmf/tex/latex/l3backend/l3backend-xetex.def    | 113 +++++++++++-------
 6 files changed, 303 insertions(+), 166 deletions(-)

diff --git a/texmf/tex/latex/l3backend/l3backend-dvipdfmx.def b/texmf/tex/latex/l3backend/l3backend-dvipdfmx.def
index 213b8963..9947b283 100644
--- a/texmf/tex/latex/l3backend/l3backend-dvipdfmx.def
+++ b/texmf/tex/latex/l3backend/l3backend-dvipdfmx.def
@@ -26,7 +26,7 @@
 %% 
 %% File: l3backend-basics.dtx
 \ProvidesExplFile
-  {l3backend-dvipdfmx.def}{2021-01-09}{}
+  {l3backend-dvipdfmx.def}{2020-01-29}{}
   {L3 backend support: dvipdfmx}
 \cs_if_exist:NTF \__kernel_dependency_version_check:nn
   {
@@ -819,36 +819,43 @@
         ]
       }
   }
-\cs_new_protected:Npn \__pdf_backend_destination_box:nn #1#2
+\cs_new_protected:Npn \__pdf_backend_destination:nnnn #1#2#3#4
   {
-    \group_begin:
-      \hbox_set:Nn \l__pdf_internal_box {#2}
-      \box_move_down:nn { \box_dp:N \l__pdf_internal_box }
-        {
-          \hbox:n
-            {
-              \__pdf_backend:n { obj ~ @pdf_ #1 _llx ~ @xpos }
-              \__pdf_backend:n { obj ~ @pdf_ #1 _lly ~ @ypos }
-            }
-        }
-      \box_use:N \l__pdf_internal_box
-      \box_move_up:nn { \box_ht:N \l__pdf_internal_box }
-        {
-          \hbox:n
-            {
-              \__pdf_backend:n
-                {
-                  dest ~ (#1)
-                  [
-                    @thispage
-                    /FitR ~
-                      @pdf_ #1 _llx ~ @pdf_ #1 _lly ~
-                      @xpos ~ @ypos
-                  ]
-                }
-            }
-        }
-    \group_end:
+    \exp_args:Ne \__pdf_backend_destination_aux:nnnn
+      { \dim_eval:n {#2} } {#1} {#3} {#4}
+  }
+\cs_new_protected:Npn \__pdf_backend_destination_aux:nnnn #1#2#3#4
+  {
+    \vbox_to_zero:n
+      {
+        \tex_kern:D \dim_eval:n {#4} \scan_stop:
+        \hbox:n
+          {
+            \__pdf_backend:n { obj ~ @pdf_ #2 _llx ~ @xpos }
+            \__pdf_backend:n { obj ~ @pdf_ #2 _lly ~ @ypos }
+          }
+        \tex_vss:D
+      }
+    \tex_kern:D #1 \scan_stop:
+    \vbox_to_zero:n
+      {
+        \tex_kern:D \dim_eval:n { -#3 } \scan_stop:
+        \hbox:n
+          {
+            \__pdf_backend:n
+              {
+                dest ~ (#2)
+                [
+                  @thispage
+                  /FitR ~
+                    @pdf_ #2 _llx ~ @pdf_ #2 _lly ~
+                    @xpos ~ @ypos
+                ]
+              }
+          }
+        \tex_vss:D
+      }
+    \tex_kern:D -#1 \scan_stop:
   }
 \cs_new_protected:Npn \__pdf_backend_compresslevel:n #1
   { \__kernel_backend_literal:x { dvipdfmx:config~z~ \int_eval:n {#1} } }
@@ -881,19 +888,23 @@
     \pdfmanagement_add:nnn { Page / Resources / ExtGState }
       { opacity 1 } { << /ca ~ 1 /CA ~ 1 >> }
   }
+\tl_new:N \l__opacity_backend_fill_tl
+\tl_new:N \l__opacity_backend_stroke_tl
 \cs_new_protected:Npn \__opacity_backend_select:n #1
  {
    \exp_args:Nx \__opacity_backend_select_aux:n
      { \fp_eval:n { min(max(0,#1),1) } }
-   \group_insert_after:N \__opacity_backend_reset:
  }
 \cs_new_protected:Npn \__opacity_backend_select_aux:n #1
   {
+    \tl_set:Nn \l__opacity_backend_fill_tl {#1}
+    \tl_set:Nn \l__opacity_backend_stroke_tl {#1}
     \pdfmanagement_add:nnn { Page / Resources / ExtGState }
       { opacity #1 }
       { << /ca ~ #1 /CA ~ #1 >> }
-   \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
-     { /opacity #1 ~ gs }
+    \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
+      { /opacity #1 ~ gs }
+    \group_insert_after:N \__opacity_backend_reset:
   }
 \cs_if_exist:NF \pdfmanagement_add:nnn
   {
@@ -902,21 +913,64 @@
 \cs_new_protected:Npn \__opacity_backend_reset:
  { \__opacity_backend_stack_pop:n \c__opacity_backend_stack_int }
 \cs_new_protected:Npn \__opacity_backend_fill:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { ca } }
+  {
+    \__opacity_backend_fill_stroke:xx
+      { \fp_eval:n { min(max(0,#1),1) } }
+      \l__opacity_backend_stroke_tl
+  }
 \cs_new_protected:Npn \__opacity_backend_stroke:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { CA } }
-\cs_new_protected:Npn \__opacity_backend:nn #1#2
   {
-    \pdfmanagement_add:nnn { Page / Resources / ExtGState }
-      { opacity #1 }
-      { << /#2 ~ #1 >> }
-   \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
-     { /opacity #1 ~ gs }
+    \__opacity_backend_fill_stroke:xx
+      \l__opacity_backend_fill_tl
+      { \fp_eval:n { min(max(0,#1),1) } }
   }
-\cs_generate_variant:Nn \__opacity_backend:nn { x }
+\cs_new_protected:Npn \__opacity_backend_fill_stroke:nn #1#2
+  {
+    \str_if_eq:nnTF {#1} {#2}
+      { \__opacity_backend_select_aux:n {#1} }
+      {
+        \tl_set:Nn \l__opacity_backend_fill_tl {#1}
+        \tl_set:Nn \l__opacity_backend_stroke_tl {#2}
+        \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+          { opacity.fill #1 }
+          { << /ca ~ #1 >> }
+        \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+          { opacity.stroke #1 }
+          { << /CA ~ #2 >> }
+        \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
+         { /opacity.fill #1 ~ gs /opacity.stroke #2 ~ gs }
+        \group_insert_after:N \__opacity_backend_reset:
+      }
+  }
+\cs_generate_variant:Nn \__opacity_backend_fill_stroke:nn { xx }
 \int_compare:nNnT \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
   {
-    \cs_gset_protected:Npn \__opacity_backend_select:n #1 { }
+    \cs_gset_protected:Npn \__opacity_backend_select_aux:n #1
+      {
+        \tl_set:Nn \l__opacity_backend_fill_tl {#1}
+        \tl_set:Nn \l__opacity_backend_stroke_tl {#1}
+        \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+          { opacity #1 }
+          { << /ca ~ #1 /CA ~ #1 >> }
+        \__kernel_backend_literal_pdf:n { /opacity #1 ~ gs }
+      }
+    \cs_gset_protected:Npn \__opacity_backend_fill_stroke:nn #1#2
+      {
+        \str_if_eq:nnTF {#1} {#2}
+          { \__opacity_backend_select_aux:n {#1} }
+          {
+            \tl_set:Nn \l__opacity_backend_fill_tl {#1}
+            \tl_set:Nn \l__opacity_backend_stroke_tl {#2}
+            \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+              { opacity.fill #1 }
+              { << /ca ~ #1 >> }
+            \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+              { opacity.stroke #1 }
+              { << /CA ~ #2 >> }
+            \__kernel_backend_literal_pdf:n
+             { /opacity.fill #1 ~ gs /opacity.stroke #2 ~ gs }
+          }
+      }
   }
 %% 
 %%
diff --git a/texmf/tex/latex/l3backend/l3backend-dvips.def b/texmf/tex/latex/l3backend/l3backend-dvips.def
index dfdc3101..ff4307c4 100644
--- a/texmf/tex/latex/l3backend/l3backend-dvips.def
+++ b/texmf/tex/latex/l3backend/l3backend-dvips.def
@@ -26,7 +26,7 @@
 %% 
 %% File: l3backend-basics.dtx
 \ProvidesExplFile
-  {l3backend-dvips.def}{2021-01-09}{}
+  {l3backend-dvips.def}{2020-01-29}{}
   {L3 backend support: dvips}
 \cs_if_exist:NTF \__kernel_dependency_version_check:nn
   {
@@ -905,29 +905,38 @@
         /DEST
       }
   }
-\cs_new_protected:Npn \__pdf_backend_destination_box:nn #1#2
-  {
-    \group_begin:
-      \hbox_set:Nn \l__pdf_internal_box {#2}
-      \box_move_down:nn
-        { \box_dp:N \l__pdf_internal_box }
-        { \hbox:n { \__kernel_backend_postscript:n { pdf.save.ll } } }
-      \box_use:N \l__pdf_internal_box
-      \box_move_up:nn
-        { \box_ht:N \l__pdf_internal_box }
-        { \hbox:n { \__kernel_backend_postscript:n { pdf.save.ur } } }
-      \__pdf_backend_pdfmark:n
-        {
-          /View
-          [
-            /FitR ~
-              pdf.llx ~ pdf.lly ~ pdf.dest2device ~
-              pdf.urx ~ pdf.ury ~ pdf.dest2device
-          ]
-          /Dest ( #1 ) cvn
-          /DEST
-        }
-    \group_end:
+\cs_new_protected:Npn \__pdf_backend_destination:nnnn #1#2#3#4
+  {
+    \exp_args:Ne \__pdf_backend_destination_aux:nnnn
+      { \dim_eval:n {#2} } {#1} {#3} {#4}
+  }
+\cs_new_protected:Npn \__pdf_backend_destination_aux:nnnn #1#2#3#4
+  {
+    \vbox_to_zero:n
+      {
+        \tex_kern:D \dim_eval:n {#4} \scan_stop:
+        \hbox:n { \__kernel_backend_postscript:n { pdf.save.ll } }
+        \tex_vss:D
+      }
+    \tex_kern:D #1 \scan_stop:
+    \vbox_to_zero:n
+      {
+        \tex_kern:D \dim_eval:n { -#3 } \scan_stop:
+        \hbox:n { \__kernel_backend_postscript:n { pdf.save.ur } }
+        \tex_vss:D
+      }
+    \tex_kern:D -#1 \scan_stop:
+    \__pdf_backend_pdfmark:n
+      {
+        /View
+        [
+          /FitR ~
+            pdf.llx ~ pdf.lly ~ pdf.dest2device ~
+            pdf.urx ~ pdf.ury ~ pdf.dest2device
+        ]
+        /Dest ( #2 ) cvn
+        /DEST
+      }
   }
 \cs_new_protected:Npn \__pdf_backend_compresslevel:n #1
   {
@@ -962,11 +971,20 @@
 \cs_new_protected:Npn \__pdf_backend_emc:
   { \__pdf_backend_pdfmark:n { /EMC } }
 %% File: l3backend-opacity.dtx
-\cs_new_protected:Npn \__opacity_backend_select:n #1 { }
+\cs_new_protected:Npn \__opacity_backend_select:n #1
+  {
+    \exp_args:Nx \__opacity_backend_select_aux:n
+      { \fp_eval:n { min(max(0,#1),1) } }
+  }
+\cs_new_protected:Npn \__opacity_backend_select_aux:n #1
+  {
+    \__kernel_backend_postscript:n
+      { #1 ~ .setfillconstantalpha ~ #1 ~ .setstrokeconstantalpha }
+  }
 \cs_new_protected:Npn \__opacity_backend_fill:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { fill } }
+  { \__opacity_backend:xn { \fp_eval:n { min(max(0,#1),1) } } { fill } }
 \cs_new_protected:Npn \__opacity_backend_stroke:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { stroke } }
+  { \__opacity_backend:xn { \fp_eval:n { min(max(0,#1),1) } } { stroke } }
 \cs_new_protected:Npn \__opacity_backend:nn #1#2
   {
     \__kernel_backend_postscript:n { #1 ~ .set #2 constantalpha  }
diff --git a/texmf/tex/latex/l3backend/l3backend-dvisvgm.def b/texmf/tex/latex/l3backend/l3backend-dvisvgm.def
index b8172232..1f8ebeb0 100644
--- a/texmf/tex/latex/l3backend/l3backend-dvisvgm.def
+++ b/texmf/tex/latex/l3backend/l3backend-dvisvgm.def
@@ -26,7 +26,7 @@
 %% 
 %% File: l3backend-basics.dtx
 \ProvidesExplFile
-  {l3backend-dvisvgm.def}{2021-01-09}{}
+  {l3backend-dvisvgm.def}{2020-01-29}{}
   {L3 backend support: dvisvgm}
 \cs_if_exist:NTF \__kernel_dependency_version_check:nn
   {
@@ -526,14 +526,14 @@
 \cs_new_protected:Npn \__pdf_backend_bdc:nn #1#2 { }
 \cs_new_protected:Npn \__pdf_backend_emc: { }
 %% File: l3backend-opacity.dtx
-\cs_new_protected:Npn \__opacity_backend_select:n #1 { }
+\cs_new_protected:Npn \__opacity_backend_select:n #1
+  { \__opacity_backend:nn {#1} { } }
 \cs_new_protected:Npn \__opacity_backend_fill:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { fill } }
+  { \__opacity_backend:nn {#1} { fill- } }
 \cs_new_protected:Npn \__opacity_backend_stroke:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { stroke } }
+  { \__opacity_backend:nn { {#1} } { stroke- } }
 \cs_new_protected:Npn \__opacity_backend:nn #1#2
-  { \__kernel_backend_scope:n { #2 -opacity = "#1" } }
-\cs_generate_variant:Nn \__opacity_backend:nn { x }
+  { \__kernel_backend_scope:x { #2 opacity = " \fp_eval:n { min(max(0,#1),1) } " } }
 %% 
 %%
 %% End of file `l3backend-dvisvgm.def'.
diff --git a/texmf/tex/latex/l3backend/l3backend-luatex.def b/texmf/tex/latex/l3backend/l3backend-luatex.def
index 6fd59fc5..1a5b246f 100644
--- a/texmf/tex/latex/l3backend/l3backend-luatex.def
+++ b/texmf/tex/latex/l3backend/l3backend-luatex.def
@@ -26,7 +26,7 @@
 %% 
 %% File: l3backend-basics.dtx
 \ProvidesExplFile
-  {l3backend-luatex.def}{2021-01-09}{}
+  {l3backend-luatex.def}{2020-01-29}{}
   {L3 backend support: PDF output (LuaTeX)}
 \cs_if_exist:NTF \__kernel_dependency_version_check:nn
   {
@@ -614,18 +614,14 @@
           { xyz ~ zoom \fp_eval:n { #2 * 10 } }
         \scan_stop:
   }
-\cs_new_protected:Npn \__pdf_backend_destination_box:nn #1#2
+\cs_new_protected:Npn \__pdf_backend_destination:nnnn #1#2#3#4
   {
-    \group_begin:
-      \hbox_set:Nn \l__pdf_internal_box {#2}
-      \tex_pdfextension:D dest ~
-      name {#1}
-      fitr ~
-        width  \box_wd:N \l__pdf_internal_box
-        height \box_ht:N \l__pdf_internal_box
-        depth  \box_dp:N \l__pdf_internal_box
-      \box_use:N \l__pdf_internal_box
-    \group_end:
+    \tex_pdfextension:D dest ~
+    name {#1}
+    fitr ~
+      width  \dim_eval:n {#2} ~
+      height \dim_eval:n {#3} ~
+      depth  \dim_eval:n {#4} \scan_stop:
   }
 \cs_new_protected:Npn \__pdf_backend_catalog_gput:nn #1#2
   {
@@ -763,19 +759,23 @@
     \pdfmanagement_add:nnn { Page / Resources / ExtGState }
       { opacity 1 } { << /ca ~ 1 /CA ~ 1 >> }
   }
+\tl_new:N \l__opacity_backend_fill_tl
+\tl_new:N \l__opacity_backend_stroke_tl
 \cs_new_protected:Npn \__opacity_backend_select:n #1
  {
    \exp_args:Nx \__opacity_backend_select_aux:n
      { \fp_eval:n { min(max(0,#1),1) } }
-   \group_insert_after:N \__opacity_backend_reset:
  }
 \cs_new_protected:Npn \__opacity_backend_select_aux:n #1
   {
+    \tl_set:Nn \l__opacity_backend_fill_tl {#1}
+    \tl_set:Nn \l__opacity_backend_stroke_tl {#1}
     \pdfmanagement_add:nnn { Page / Resources / ExtGState }
       { opacity #1 }
       { << /ca ~ #1 /CA ~ #1 >> }
-   \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
-     { /opacity #1 ~ gs }
+    \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
+      { /opacity #1 ~ gs }
+    \group_insert_after:N \__opacity_backend_reset:
   }
 \cs_if_exist:NF \pdfmanagement_add:nnn
   {
@@ -784,18 +784,36 @@
 \cs_new_protected:Npn \__opacity_backend_reset:
  { \__opacity_backend_stack_pop:n \c__opacity_backend_stack_int }
 \cs_new_protected:Npn \__opacity_backend_fill:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { ca } }
+  {
+    \__opacity_backend_fill_stroke:xx
+      { \fp_eval:n { min(max(0,#1),1) } }
+      \l__opacity_backend_stroke_tl
+  }
 \cs_new_protected:Npn \__opacity_backend_stroke:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { CA } }
-\cs_new_protected:Npn \__opacity_backend:nn #1#2
   {
-    \pdfmanagement_add:nnn { Page / Resources / ExtGState }
-      { opacity #1 }
-      { << /#2 ~ #1 >> }
-   \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
-     { /opacity #1 ~ gs }
+    \__opacity_backend_fill_stroke:xx
+      \l__opacity_backend_fill_tl
+      { \fp_eval:n { min(max(0,#1),1) } }
+  }
+\cs_new_protected:Npn \__opacity_backend_fill_stroke:nn #1#2
+  {
+    \str_if_eq:nnTF {#1} {#2}
+      { \__opacity_backend_select_aux:n {#1} }
+      {
+        \tl_set:Nn \l__opacity_backend_fill_tl {#1}
+        \tl_set:Nn \l__opacity_backend_stroke_tl {#2}
+        \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+          { opacity.fill #1 }
+          { << /ca ~ #1 >> }
+        \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+          { opacity.stroke #1 }
+          { << /CA ~ #2 >> }
+        \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
+         { /opacity.fill #1 ~ gs /opacity.stroke #2 ~ gs }
+        \group_insert_after:N \__opacity_backend_reset:
+      }
   }
-\cs_generate_variant:Nn \__opacity_backend:nn { x }
+\cs_generate_variant:Nn \__opacity_backend_fill_stroke:nn { xx }
 %% 
 %%
 %% End of file `l3backend-luatex.def'.
diff --git a/texmf/tex/latex/l3backend/l3backend-pdftex.def b/texmf/tex/latex/l3backend/l3backend-pdftex.def
index 34c1154a..1c1e221a 100644
--- a/texmf/tex/latex/l3backend/l3backend-pdftex.def
+++ b/texmf/tex/latex/l3backend/l3backend-pdftex.def
@@ -26,7 +26,7 @@
 %% 
 %% File: l3backend-basics.dtx
 \ProvidesExplFile
-  {l3backend-pdftex.def}{2021-01-09}{}
+  {l3backend-pdftex.def}{2020-01-29}{}
   {L3 backend support: PDF output (pdfTeX)}
 \cs_if_exist:NTF \__kernel_dependency_version_check:nn
   {
@@ -614,18 +614,14 @@
           { xyz ~ zoom \fp_eval:n { #2 * 10 } }
         \scan_stop:
   }
-\cs_new_protected:Npn \__pdf_backend_destination_box:nn #1#2
+\cs_new_protected:Npn \__pdf_backend_destination:nnnn #1#2#3#4
   {
-    \group_begin:
-      \hbox_set:Nn \l__pdf_internal_box {#2}
-      \tex_pdfdest:D
-      name {#1}
-      fitr ~
-        width  \box_wd:N \l__pdf_internal_box
-        height \box_ht:N \l__pdf_internal_box
-        depth  \box_dp:N \l__pdf_internal_box
-      \box_use:N \l__pdf_internal_box
-    \group_end:
+    \tex_pdfdest:D
+    name {#1}
+    fitr ~
+      width  \dim_eval:n {#2} ~
+      height \dim_eval:n {#3} ~
+      depth  \dim_eval:n {#4} \scan_stop:
   }
 \cs_new_protected:Npn \__pdf_backend_catalog_gput:nn #1#2
   {
@@ -763,19 +759,23 @@
     \pdfmanagement_add:nnn { Page / Resources / ExtGState }
       { opacity 1 } { << /ca ~ 1 /CA ~ 1 >> }
   }
+\tl_new:N \l__opacity_backend_fill_tl
+\tl_new:N \l__opacity_backend_stroke_tl
 \cs_new_protected:Npn \__opacity_backend_select:n #1
  {
    \exp_args:Nx \__opacity_backend_select_aux:n
      { \fp_eval:n { min(max(0,#1),1) } }
-   \group_insert_after:N \__opacity_backend_reset:
  }
 \cs_new_protected:Npn \__opacity_backend_select_aux:n #1
   {
+    \tl_set:Nn \l__opacity_backend_fill_tl {#1}
+    \tl_set:Nn \l__opacity_backend_stroke_tl {#1}
     \pdfmanagement_add:nnn { Page / Resources / ExtGState }
       { opacity #1 }
       { << /ca ~ #1 /CA ~ #1 >> }
-   \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
-     { /opacity #1 ~ gs }
+    \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
+      { /opacity #1 ~ gs }
+    \group_insert_after:N \__opacity_backend_reset:
   }
 \cs_if_exist:NF \pdfmanagement_add:nnn
   {
@@ -784,18 +784,36 @@
 \cs_new_protected:Npn \__opacity_backend_reset:
  { \__opacity_backend_stack_pop:n \c__opacity_backend_stack_int }
 \cs_new_protected:Npn \__opacity_backend_fill:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { ca } }
+  {
+    \__opacity_backend_fill_stroke:xx
+      { \fp_eval:n { min(max(0,#1),1) } }
+      \l__opacity_backend_stroke_tl
+  }
 \cs_new_protected:Npn \__opacity_backend_stroke:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { CA } }
-\cs_new_protected:Npn \__opacity_backend:nn #1#2
   {
-    \pdfmanagement_add:nnn { Page / Resources / ExtGState }
-      { opacity #1 }
-      { << /#2 ~ #1 >> }
-   \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
-     { /opacity #1 ~ gs }
+    \__opacity_backend_fill_stroke:xx
+      \l__opacity_backend_fill_tl
+      { \fp_eval:n { min(max(0,#1),1) } }
+  }
+\cs_new_protected:Npn \__opacity_backend_fill_stroke:nn #1#2
+  {
+    \str_if_eq:nnTF {#1} {#2}
+      { \__opacity_backend_select_aux:n {#1} }
+      {
+        \tl_set:Nn \l__opacity_backend_fill_tl {#1}
+        \tl_set:Nn \l__opacity_backend_stroke_tl {#2}
+        \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+          { opacity.fill #1 }
+          { << /ca ~ #1 >> }
+        \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+          { opacity.stroke #1 }
+          { << /CA ~ #2 >> }
+        \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
+         { /opacity.fill #1 ~ gs /opacity.stroke #2 ~ gs }
+        \group_insert_after:N \__opacity_backend_reset:
+      }
   }
-\cs_generate_variant:Nn \__opacity_backend:nn { x }
+\cs_generate_variant:Nn \__opacity_backend_fill_stroke:nn { xx }
 %% 
 %%
 %% End of file `l3backend-pdftex.def'.
diff --git a/texmf/tex/latex/l3backend/l3backend-xetex.def b/texmf/tex/latex/l3backend/l3backend-xetex.def
index e5a60b86..d9bf8704 100644
--- a/texmf/tex/latex/l3backend/l3backend-xetex.def
+++ b/texmf/tex/latex/l3backend/l3backend-xetex.def
@@ -26,7 +26,7 @@
 %% 
 %% File: l3backend-basics.dtx
 \ProvidesExplFile
-  {l3backend-xetex.def}{2021-01-09}{}
+  {l3backend-xetex.def}{2020-01-29}{}
   {L3 backend support: XeTeX}
 \cs_if_exist:NTF \__kernel_dependency_version_check:nn
   {
@@ -865,36 +865,43 @@
         ]
       }
   }
-\cs_new_protected:Npn \__pdf_backend_destination_box:nn #1#2
+\cs_new_protected:Npn \__pdf_backend_destination:nnnn #1#2#3#4
   {
-    \group_begin:
-      \hbox_set:Nn \l__pdf_internal_box {#2}
-      \box_move_down:nn { \box_dp:N \l__pdf_internal_box }
-        {
-          \hbox:n
-            {
-              \__pdf_backend:n { obj ~ @pdf_ #1 _llx ~ @xpos }
-              \__pdf_backend:n { obj ~ @pdf_ #1 _lly ~ @ypos }
-            }
-        }
-      \box_use:N \l__pdf_internal_box
-      \box_move_up:nn { \box_ht:N \l__pdf_internal_box }
-        {
-          \hbox:n
-            {
-              \__pdf_backend:n
-                {
-                  dest ~ (#1)
-                  [
-                    @thispage
-                    /FitR ~
-                      @pdf_ #1 _llx ~ @pdf_ #1 _lly ~
-                      @xpos ~ @ypos
-                  ]
-                }
-            }
-        }
-    \group_end:
+    \exp_args:Ne \__pdf_backend_destination_aux:nnnn
+      { \dim_eval:n {#2} } {#1} {#3} {#4}
+  }
+\cs_new_protected:Npn \__pdf_backend_destination_aux:nnnn #1#2#3#4
+  {
+    \vbox_to_zero:n
+      {
+        \tex_kern:D \dim_eval:n {#4} \scan_stop:
+        \hbox:n
+          {
+            \__pdf_backend:n { obj ~ @pdf_ #2 _llx ~ @xpos }
+            \__pdf_backend:n { obj ~ @pdf_ #2 _lly ~ @ypos }
+          }
+        \tex_vss:D
+      }
+    \tex_kern:D #1 \scan_stop:
+    \vbox_to_zero:n
+      {
+        \tex_kern:D \dim_eval:n { -#3 } \scan_stop:
+        \hbox:n
+          {
+            \__pdf_backend:n
+              {
+                dest ~ (#2)
+                [
+                  @thispage
+                  /FitR ~
+                    @pdf_ #2 _llx ~ @pdf_ #2 _lly ~
+                    @xpos ~ @ypos
+                ]
+              }
+          }
+        \tex_vss:D
+      }
+    \tex_kern:D -#1 \scan_stop:
   }
 \cs_new_protected:Npn \__pdf_backend_compresslevel:n #1
   { \__kernel_backend_literal:x { dvipdfmx:config~z~ \int_eval:n {#1} } }
@@ -927,19 +934,23 @@
     \pdfmanagement_add:nnn { Page / Resources / ExtGState }
       { opacity 1 } { << /ca ~ 1 /CA ~ 1 >> }
   }
+\tl_new:N \l__opacity_backend_fill_tl
+\tl_new:N \l__opacity_backend_stroke_tl
 \cs_new_protected:Npn \__opacity_backend_select:n #1
  {
    \exp_args:Nx \__opacity_backend_select_aux:n
      { \fp_eval:n { min(max(0,#1),1) } }
-   \group_insert_after:N \__opacity_backend_reset:
  }
 \cs_new_protected:Npn \__opacity_backend_select_aux:n #1
   {
+    \tl_set:Nn \l__opacity_backend_fill_tl {#1}
+    \tl_set:Nn \l__opacity_backend_stroke_tl {#1}
     \pdfmanagement_add:nnn { Page / Resources / ExtGState }
       { opacity #1 }
       { << /ca ~ #1 /CA ~ #1 >> }
-   \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
-     { /opacity #1 ~ gs }
+    \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
+      { /opacity #1 ~ gs }
+    \group_insert_after:N \__opacity_backend_reset:
   }
 \cs_if_exist:NF \pdfmanagement_add:nnn
   {
@@ -948,18 +959,36 @@
 \cs_new_protected:Npn \__opacity_backend_reset:
  { \__opacity_backend_stack_pop:n \c__opacity_backend_stack_int }
 \cs_new_protected:Npn \__opacity_backend_fill:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { ca } }
+  {
+    \__opacity_backend_fill_stroke:xx
+      { \fp_eval:n { min(max(0,#1),1) } }
+      \l__opacity_backend_stroke_tl
+  }
 \cs_new_protected:Npn \__opacity_backend_stroke:n #1
-  { \__opacity_backend:nn { \fp_eval:n { min(max(0,#1),1) } } { CA } }
-\cs_new_protected:Npn \__opacity_backend:nn #1#2
   {
-    \pdfmanagement_add:nnn { Page / Resources / ExtGState }
-      { opacity #1 }
-      { << /#2 ~ #1 >> }
-   \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
-     { /opacity #1 ~ gs }
+    \__opacity_backend_fill_stroke:xx
+      \l__opacity_backend_fill_tl
+      { \fp_eval:n { min(max(0,#1),1) } }
+  }
+\cs_new_protected:Npn \__opacity_backend_fill_stroke:nn #1#2
+  {
+    \str_if_eq:nnTF {#1} {#2}
+      { \__opacity_backend_select_aux:n {#1} }
+      {
+        \tl_set:Nn \l__opacity_backend_fill_tl {#1}
+        \tl_set:Nn \l__opacity_backend_stroke_tl {#2}
+        \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+          { opacity.fill #1 }
+          { << /ca ~ #1 >> }
+        \pdfmanagement_add:nnn { Page / Resources / ExtGState }
+          { opacity.stroke #1 }
+          { << /CA ~ #2 >> }
+        \__opacity_backend_stack_push:nn \c__opacity_backend_stack_int
+         { /opacity.fill #1 ~ gs /opacity.stroke #2 ~ gs }
+        \group_insert_after:N \__opacity_backend_reset:
+      }
   }
-\cs_generate_variant:Nn \__opacity_backend:nn { x }
+\cs_generate_variant:Nn \__opacity_backend_fill_stroke:nn { xx }
 %% 
 %%
 %% End of file `l3backend-xetex.def'.





More information about the latex3-commits mailing list.