[latex3-commits] [git/LaTeX3-latex3-pdfresources] backendtest: moved xetex code (59c0d94)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon Aug 5 22:34:05 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : backendtest
Link       : https://github.com/latex3/pdfresources/commit/59c0d947f785bed1f5460460c71aa85a7709b7ed

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

commit 59c0d947f785bed1f5460460c71aa85a7709b7ed
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Aug 5 22:34:05 2019 +0200

    moved xetex code


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

59c0d947f785bed1f5460460c71aa85a7709b7ed
 experiments/xform-tests.tex | 67 +--------------------------------------------
 pdfresources.dtx            | 67 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 67 insertions(+), 67 deletions(-)

diff --git a/experiments/xform-tests.tex b/experiments/xform-tests.tex
index b0966b4..f3ac0c9 100644
--- a/experiments/xform-tests.tex
+++ b/experiments/xform-tests.tex
@@ -22,77 +22,12 @@
    %only for the test here
   \cs_new:Npn \xxx_pdfresources: {\tex_the:D \tex_pdfvariable:D pageresources}
 }
-% already in pdfresources
-%  \cs_new:Npn \__pdf_backend_xform_ref:n #1 %#1 name
-%  \cs_new:Npn \__pdf_backend_xform_use:n #1 %#1 name
-%   \cs_new:Npn  \pdf_xform_ref:n #1
 
 
 
 \sys_if_engine_xetex:T
 {
-% it needs a bit testing if it really works to set the box to 0 before the special ...
-% does it disturb viewing the xobject?
-% what happens with the resources (bdc)? (should work as they are specials too)
-\cs_new:Npn \__pdf_backend_xform_new:nnnn #1 #2 #3 #4
-  % #1 name
-  % #2 attributes
-  % #3 resources
-  % #4 content, not necessarly a box!
- {
-  \int_gincr:N \g__pdf_backend_object_int
-  \int_const:cn
-      { c__pdf_backend_xform_ \tl_to_str:n {#1} _int }
-      { \g__pdf_backend_object_int }
-  \hbox_set:Nn \l__pdf_backend_tmpa_box
-    {
-     \bool_set_true:N \l__pdf_backend_xform_bool
-     #4
-    }
-   \tl_const:cx
-     { c__pdf_backend_xform_wd_ \tl_to_str:n {#1} _tl }
-     { \tex_the:D \box_wd:N \l__pdf_backend_tmpa_box }
-   \tl_const:cx
-     { c__pdf_backend_xform_ht_ \tl_to_str:n {#1} _tl }
-     { \tex_the:D \box_ht:N \l__pdf_backend_tmpa_box }
-   \tl_const:cx
-     { c__pdf_backend_xform_dp_ \tl_to_str:n {#1} _tl }
-     { \tex_the:D \box_dp:N \l__pdf_backend_tmpa_box }
-   \box_set_dp:Nn  \l__pdf_backend_tmpa_box { \c_zero_dim }
-   \box_set_ht:Nn  \l__pdf_backend_tmpa_box { \c_zero_dim }
-   \box_set_wd:Nn  \l__pdf_backend_tmpa_box { \c_zero_dim }
-   \exp_args:Nx
-    \__pdf_backend:n
-    { 
-       bxobj  ~ \__pdf_backend_xform_ref:n  { #1 }
-       \c_space_tl width  ~ \pdf_xform_wd:n { #1 }
-       \c_space_tl height ~ \pdf_xform_ht:n { #1 }
-       \c_space_tl depth  ~ \pdf_xform_dp:n { #1 } 
-    }
-   \box_use_drop:N \l__pdf_backend_tmpa_box
-  \exp_args:Nx\__pdf_backend:n {put ~ @resources ~<<#3>> }
-  \exp_args:Nx\__pdf_backend:n{exobj ~<<#2>>}
- }
- 
- \cs_new:Npn \__pdf_backend_xform_ref:n #1
-  { @pdf.xform \int_use:c { c__pdf_backend_xform_ \tl_to_str:n {#1} _int } }
-  
- \cs_new:Npn \__pdf_backend_xform_use:n #1
- {
-  \hbox_set:Nn \l__pdf_backend_tmpa_box
-   {
-    \exp_args:Nx 
-    \__pdf_backend:n
-     {
-      uxobj~ \__pdf_backend_xform_ref:n { #1 }
-     }
-   }
-   \box_set_wd:Nn  \l__pdf_backend_tmpa_box { \pdf_xform_wd:n { #1 } }
-   \box_set_ht:Nn  \l__pdf_backend_tmpa_box { \pdf_xform_ht:n { #1 } }
-   \box_set_dp:Nn  \l__pdf_backend_tmpa_box { \pdf_xform_dp:n { #1 } }
-   \box_use_drop:N \l__pdf_backend_tmpa_box 
- }
-\cs_new:Npn \xxx_pdfresources: {/ExtGState~@pgfextgs} 
+ \cs_new:Npn \xxx_pdfresources: {/ExtGState~@pgfextgs} 
 }
 \ExplSyntaxOff
 \begin{document}
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 83ebe5b..251fb78 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -1025,7 +1025,7 @@
    \@@_backend_xform_use:n { #1 }
   }
 % expansion?
- \cs_new:NpN \pdf_xform_ref:n #1
+ \cs_new:Npn \pdf_xform_ref:n #1
   {
    \@@_backend_xform_ref:n { #1 }
   }
@@ -1152,6 +1152,71 @@
   { \int_use:c { c_@@_backend_xform_ \tl_to_str:n {#1} _int } ~ 0 ~ R }
 }
 
+
+\sys_if_engine_xetex:T
+{
+% it needs a bit testing if it really works to set the box to 0 before the special ...
+% does it disturb viewing the xobject?
+% what happens with the resources (bdc)? (should work as they are specials too)
+\cs_new:Npn \@@_backend_xform_new:nnnn #1 #2 #3 #4
+  % #1 name
+  % #2 attributes
+  % #3 resources
+  % #4 content, not necessarly a box!
+ {
+  \int_gincr:N \g_@@_backend_object_int
+  \int_const:cn
+      { c_@@_backend_xform_ \tl_to_str:n {#1} _int }
+      { \g_@@_backend_object_int }
+  \hbox_set:Nn \l_@@_backend_tmpa_box
+    {
+     \bool_set_true:N \l_@@_backend_xform_bool
+     #4
+    }
+   \tl_const:cx
+     { c_@@_backend_xform_wd_ \tl_to_str:n {#1} _tl }
+     { \tex_the:D \box_wd:N \l_@@_backend_tmpa_box }
+   \tl_const:cx
+     { c_@@_backend_xform_ht_ \tl_to_str:n {#1} _tl }
+     { \tex_the:D \box_ht:N \l_@@_backend_tmpa_box }
+   \tl_const:cx
+     { c_@@_backend_xform_dp_ \tl_to_str:n {#1} _tl }
+     { \tex_the:D \box_dp:N \l_@@_backend_tmpa_box }
+   \box_set_dp:Nn  \l_@@_backend_tmpa_box { \c_zero_dim }
+   \box_set_ht:Nn  \l_@@_backend_tmpa_box { \c_zero_dim }
+   \box_set_wd:Nn  \l_@@_backend_tmpa_box { \c_zero_dim }
+   \exp_args:Nx
+    \@@_backend:n
+    {
+       bxobj  ~ \@@_backend_xform_ref:n  { #1 }
+       \c_space_tl width  ~ \pdf_xform_wd:n { #1 }
+       \c_space_tl height ~ \pdf_xform_ht:n { #1 }
+       \c_space_tl depth  ~ \pdf_xform_dp:n { #1 }
+    }
+   \box_use_drop:N \l_@@_backend_tmpa_box
+   \exp_args:Nx\@@_backend:n {put ~ @resources ~<<#3>> }
+   \exp_args:Nx\@@_backend:n{exobj ~<<#2>>}
+ }
+
+ \cs_new:Npn \@@_backend_xform_ref:n #1
+  { @pdf.xform \int_use:c { c_@@_backend_xform_ \tl_to_str:n {#1} _int } }
+
+ \cs_new:Npn \@@_backend_xform_use:n #1
+ {
+  \hbox_set:Nn \l_@@_backend_tmpa_box
+   {
+    \exp_args:Nx
+    \@@_backend:n
+     {
+      uxobj~ \@@_backend_xform_ref:n { #1 }
+     }
+   }
+   \box_set_wd:Nn  \l_@@_backend_tmpa_box { \pdf_xform_wd:n { #1 } }
+   \box_set_ht:Nn  \l_@@_backend_tmpa_box { \pdf_xform_ht:n { #1 } }
+   \box_set_dp:Nn  \l_@@_backend_tmpa_box { \pdf_xform_dp:n { #1 } }
+   \box_use_drop:N \l_@@_backend_tmpa_box
+ }
+}
 %</package>
 %    \end{macrocode}
 





More information about the latex3-commits mailing list