[latex3-commits] [git/LaTeX3-latex3-pdfresources] test-new-hooks: corrected xform code for xelatex, adapted tests! (9132a25)

Ulrike Fischer fischer at troubleshooting-tex.de
Sat May 23 19:28:02 CEST 2020


Repository : https://github.com/latex3/pdfresources
On branch  : test-new-hooks
Link       : https://github.com/latex3/pdfresources/commit/9132a25765e2ae3d4ac8dd8b3a49da3625c28f7b

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

commit 9132a25765e2ae3d4ac8dd8b3a49da3625c28f7b
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sat May 23 19:28:02 2020 +0200

    corrected xform code for xelatex, adapted tests!


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

9132a25765e2ae3d4ac8dd8b3a49da3625c28f7b
 pdfresources.dtx                                | 138 ++++++++--------
 testfiles/formtextfields.xetex.tpf              | 200 ++++++++++++------------
 testfiles/xform-preamble.luatex.tpf             | 137 ++++++++++++++++
 testfiles/xform-preamble.pvt                    |  14 ++
 testfiles/{catalogAF.tpf => xform-preamble.tpf} | 117 ++++++++------
 testfiles/xform-preamble.xetex.tpf              | 129 +++++++++++++++
 testfiles/xform.xetex.tpf                       |  66 ++++----
 7 files changed, 557 insertions(+), 244 deletions(-)

diff --git a/pdfresources.dtx b/pdfresources.dtx
index 0adb7f9..4f8319c 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -176,6 +176,7 @@
 \prop_new:N \g_@@_tmpa_prop
 \tl_new:N   \l_@@_tmpa_tl
 \box_new:N  \l_@@_tmpa_box
+\box_new:N  \l_@@_tmpb_box
 %    \end{macrocode}
 % \end{variable}
 %
@@ -2997,75 +2998,86 @@
    % 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)
+   % xetex requires that the special is in horizontal mode. This means it affects
+   % typesetting. But we can no delay the whole form code to shipout
+   % as the object reference and the size is often wanted on the current page.
+   % so we need to allocate a box - but probably they won't be thousands xform
+   % in a document so it shouldn't matter.
     \cs_new:Npn \@@_backend_xform_new:nnnn #1 #2 #3 #4
     % #1 name
     % #2 attributes
     % #3 resources
     % #4 content, not necessarily 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_@@_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_@@_tmpa_box }
-        \tl_const:cx
-          { c_@@_backend_xform_ht_ \tl_to_str:n {#1} _tl }
-          { \tex_the:D \box_ht:N \l_@@_tmpa_box }
-        \tl_const:cx
-          { c_@@_backend_xform_dp_ \tl_to_str:n {#1} _tl }
-          { \tex_the:D \box_dp:N \l_@@_tmpa_box }
-        \box_set_dp:Nn  \l_@@_tmpa_box { \c_zero_dim }
-        \box_set_ht:Nn  \l_@@_tmpa_box { \c_zero_dim }
-        \box_set_wd:Nn  \l_@@_tmpa_box { \c_zero_dim }
-        \mode_leave_vertical: %needed, the xform disappears without it.
-        \@@_backend:x
-          {
-            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_@@_tmpa_box
-        \@@_backend:x {put ~ @resources ~<<#3>> }
-        \@@_backend:x
-          {
-            put~ @resources ~
-              <<
-                /ExtGState~ \pdf_object_ref:n {Page/Resources/ExtGState}
-              >>
-          }
-        \@@_backend:x
-          {
-            put~ @resources ~
-            <<
-              /Pattern~ \pdf_object_ref:n {Page/Resources/Pattern}
-            >>
-          }
-        \@@_backend:x
-          {
-            put~ @resources ~
-            <<
-              /Shading~ \pdf_object_ref:n {Page/Resources/Shading}
-            >>
-          }
-        \@@_backend:x
-          {
-            put~ @resources ~
-            <<
-              /ColorSpace~
-              \pdf_object_ref:n {Page/Resources/ColorSpace}
-            >>
-          }
-        \exp_args:Nx
-        \@@_backend:x {exobj ~<<#2>>}
-     }
+         \int_gincr:N \g_@@_backend_object_int
+         \int_const:cn
+           { c_@@_backend_xform_ \tl_to_str:n {#1} _int }
+           { \g_@@_backend_object_int }
+         \box_new:c { g_@@_backend_xform_#1_box }
+         \hbox_gset:cn { g_@@_backend_xform_#1_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:c { g_@@_backend_xform_#1_box } }
+         \tl_const:cx
+           { c_@@_backend_xform_ht_ \tl_to_str:n {#1} _tl }
+           { \tex_the:D \box_ht:c { g_@@_backend_xform_#1_box } }
+         \tl_const:cx
+           { c_@@_backend_xform_dp_ \tl_to_str:n {#1} _tl }
+           { \tex_the:D \box_dp:c { g_@@_backend_xform_#1_box } }
+         \box_set_dp:cn  { g_@@_backend_xform_#1_box } { \c_zero_dim }
+         \box_set_ht:cn  { g_@@_backend_xform_#1_box } { \c_zero_dim }
+         \box_set_wd:cn  { g_@@_backend_xform_#1_box } { \c_zero_dim }
+         \hook_gput_next_code:nn {shipout/background}
+           {
+             \mode_leave_vertical: %needed, the xform disappears without it.
+             \@@_backend:x
+               {
+                 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:c { g_@@_backend_xform_#1_box }
+             \@@_backend:x {put ~ @resources ~<<#3>> }
+             \@@_backend:x
+               {
+                 put~ @resources ~
+                   <<
+                     /ExtGState~ \pdf_object_ref:n {Page/Resources/ExtGState}
+                   >>
+               }
+             \@@_backend:x
+               {
+                 put~ @resources ~
+                 <<
+                   /Pattern~ \pdf_object_ref:n {Page/Resources/Pattern}
+                 >>
+               }
+             \@@_backend:x
+               {
+                 put~ @resources ~
+                 <<
+                   /Shading~ \pdf_object_ref:n {Page/Resources/Shading}
+                 >>
+               }
+             \@@_backend:x
+               {
+                 put~ @resources ~
+                 <<
+                   /ColorSpace~
+                   \pdf_object_ref:n {Page/Resources/ColorSpace}
+                 >>
+               }
+             \exp_args:Nx
+             \@@_backend:x {exobj ~<<#2>>}
+           }
+      }
+
+
 
     \cs_new:Npn \@@_backend_xform_ref:n #1
       {
diff --git a/testfiles/formtextfields.xetex.tpf b/testfiles/formtextfields.xetex.tpf
index 037989d..1e528bc 100644
--- a/testfiles/formtextfields.xetex.tpf
+++ b/testfiles/formtextfields.xetex.tpf
@@ -1,87 +1,87 @@
 %PDF-1.5
 %äðíø
-18 0 obj
-<</Font<</F1 13 0 R>>/ExtGState 14 0 R/Pattern 15 0 R/Shading 16 0 R/ColorSpace 17 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+17 0 obj
+<</Font<</F1 12 0 R>>/ExtGState 13 0 R/Pattern 14 0 R/Shading 15 0 R/ColorSpace 16 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
 endobj
-12 0 obj
-<</Type/XObject/Subtype/Form/FormType 1/BBox[76.712 -62.765 80.618 -55.711]/Matrix[1
-0 0 1 -76.712 62.765]/Resources 18 0 R/Length 53>>
+11 0 obj
+<</Type/XObject/Subtype/Form/FormType 1/BBox[-72 72 -68.095 79.054]/Matrix[1 0 0
+1 72 -72]/Resources 17 0 R/Length 45>>
 stream
- 0 G 0 g BT /F1 9.9626 Tf 76.712 -62.765 Td[({)]TJ ET
+ 0 G 0 g BT /F1 9.9626 Tf -72 72 Td[({)]TJ ET
 endstream
 endobj
-20 0 obj
-<</ExtGState 14 0 R/Pattern 15 0 R/Shading 16 0 R/ColorSpace 17 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
-endobj
 19 0 obj
-<</Type/XObject/Subtype/Form/FormType 1/BBox[76.712 -62.765 80.618 -55.711]/Matrix[1
-0 0 1 -76.712 62.765]/Resources 20 0 R/Length 8>>
+<</ExtGState 13 0 R/Pattern 14 0 R/Shading 15 0 R/ColorSpace 16 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+endobj
+18 0 obj
+<</Type/XObject/Subtype/Form/FormType 1/BBox[-68.095 72 -64.189 79.054]/Matrix[1
+0 0 1 68.095 -72]/Resources 19 0 R/Length 8>>
 stream
  0 G 0 g
 endstream
 endobj
-22 0 obj
-<</Font<</F1 13 0 R>>/ExtGState 14 0 R/Pattern 15 0 R/Shading 16 0 R/ColorSpace 17 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
-endobj
 21 0 obj
-<</Type/XObject/Subtype/Form/FormType 1/BBox[76.712 -62.894 84.234 -55.711]/Matrix[1
-0 0 1 -76.712 62.765]/Resources 22 0 R/Length 53>>
+<</Font<</F1 12 0 R>>/ExtGState 13 0 R/Pattern 14 0 R/Shading 15 0 R/ColorSpace 16 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+endobj
+20 0 obj
+<</Type/XObject/Subtype/Form/FormType 1/BBox[-64.189 71.87 -56.667 79.054]/Matrix[1
+0 0 1 64.189 -72]/Resources 21 0 R/Length 49>>
 stream
- 0 G 0 g BT /F1 9.9626 Tf 76.712 -62.765 Td[(3)]TJ ET
+ 0 G 0 g BT /F1 9.9626 Tf -64.189 72 Td[(3)]TJ ET
 endstream
 endobj
-24 0 obj
-<</ExtGState 14 0 R/Pattern 15 0 R/Shading 16 0 R/ColorSpace 17 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
-endobj
 23 0 obj
-<</Type/XObject/Subtype/Form/FormType 1/BBox[76.712 -62.894 84.234 -55.711]/Matrix[1
-0 0 1 -76.712 62.765]/Resources 24 0 R/Length 8>>
+<</ExtGState 13 0 R/Pattern 14 0 R/Shading 15 0 R/ColorSpace 16 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+endobj
+22 0 obj
+<</Type/XObject/Subtype/Form/FormType 1/BBox[-56.668 71.87 -49.146 79.054]/Matrix[1
+0 0 1 56.668 -72]/Resources 23 0 R/Length 8>>
 stream
  0 G 0 g
 endstream
 endobj
-28 0 obj
-<</Font<</F2 27 0 R>>/ExtGState 14 0 R/Pattern 15 0 R/Shading 16 0 R/ColorSpace 17 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+27 0 obj
+<</Font<</F2 26 0 R>>/ExtGState 13 0 R/Pattern 14 0 R/Shading 15 0 R/ColorSpace 16 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
 endobj
-25 0 obj
-<</Type/XObject/Subtype/Form/FormType 1/BBox[76.712 -66.371 113.215 -52.244]/Matrix[1
-0 0 1 -76.712 62.765]/Resources 28 0 R/Length 270>>
+24 0 obj
+<</Type/XObject/Subtype/Form/FormType 1/BBox[-49.146 68.394 -12.643 82.521]/Matrix[1
+0 0 1 49.146 -72]/Resources 27 0 R/Length 264>>
 stream
- 0 G 0 g q .3985 w 76.712 -52.443 m 113.215 -52.443 l S Q q .3985 w 76.912 -65.973 m 76.912 -52.643 l S Q BT /F2 9.9626 Tf 80.1 -62.765 Td[<0061006d0023004b00420069>]TJ ET q .3985 w 113.016 -65.973 m 113.016 -52.643 l S Q q .3985 w 76.712 -66.172 m 113.215 -66.172 l S Q
+ 0 G 0 g q .3985 w -49.146 82.321 m -12.643 82.321 l S Q q .3985 w -48.946 68.792 m -48.946 82.122 l S Q BT /F2 9.9626 Tf -45.758 72 Td[<0061006d0023004b00420069>]TJ ET q .3985 w -12.842 68.792 m -12.842 82.122 l S Q q .3985 w -49.146 68.593 m -12.643 68.593 l S Q
 endstream
 endobj
-30 0 obj
-<</Font<</F2 27 0 R>>/ExtGState 14 0 R/Pattern 15 0 R/Shading 16 0 R/ColorSpace 17 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
-endobj
 29 0 obj
-<</Type/XObject/Subtype/Form/FormType 1/BBox[76.712 -66.371 119.582 -52.244]/Matrix[1
-0 0 1 -76.712 62.765]/Resources 30 0 R/Length 274>>
+<</Font<</F2 26 0 R>>/ExtGState 13 0 R/Pattern 14 0 R/Shading 15 0 R/ColorSpace 16 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+endobj
+28 0 obj
+<</Type/XObject/Subtype/Form/FormType 1/BBox[-12.643 68.394 30.227 82.521]/Matrix[1
+0 0 1 12.643 -72]/Resources 29 0 R/Length 263>>
 stream
- 0 G 0 g q .3985 w 76.712 -52.443 m 119.582 -52.443 l S Q q .3985 w 76.912 -65.973 m 76.912 -52.643 l S Q BT /F2 9.9626 Tf 80.1 -62.765 Td[<0061006d0023004b004200690053>]TJ ET q .3985 w 119.382 -65.973 m 119.382 -52.643 l S Q q .3985 w 76.712 -66.172 m 119.582 -66.172 l S Q
+ 0 G 0 g q .3985 w -12.643 82.321 m 30.227 82.321 l S Q q .3985 w -12.443 68.792 m -12.443 82.122 l S Q BT /F2 9.9626 Tf -9.255 72 Td[<0061006d0023004b004200690053>]TJ ET q .3985 w 30.027 68.792 m 30.027 82.122 l S Q q .3985 w -12.643 68.593 m 30.227 68.593 l S Q
 endstream
 endobj
 33 0 obj
-<</Length 169>>
+<</Length 170>>
 stream
- q 1 0 0 1 72 769.89 cm BT /F3 9.9626 Tf 76.712 -74.72 Td[<0041004d0062003200600069>-333<0068>82<003200740069>]TJ ET BT /F3 9.9626 Tf 231.133 -630.635 Td[<0052>]TJ ET Q
+ q 1 0 0 1 72 769.89 cm BT /F3 9.9626 Tf 76.712 -64.757 Td[<0041004d0062003200600069>-333<0068>82<003200740069>]TJ ET BT /F3 9.9626 Tf 231.133 -630.635 Td[<0052>]TJ ET Q
 endstream
 endobj
 34 0 obj
 <</Font<</F3 32 0 R>>/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
 endobj
-14 0 obj
+13 0 obj
 <<>>
 endobj
-17 0 obj
+16 0 obj
 <<>>
 endobj
-15 0 obj
+14 0 obj
 <<>>
 endobj
-16 0 obj
+15 0 obj
 <<>>
 endobj
-11 0 obj
+30 0 obj
 <</Type/Encoding/Differences[24/breve/caron/circumflex/dotaccent/hungarumlaut/ogonek/ring/tilde
 39/quotesingle 96/grave 128/bullet/dagger/daggerdbl/ellipsis/emdash/endash/florin/fraction/guilsinglleft/guilsinglright/minus/perthousand/quotedblbase/quotedblleft/quotedblright/quoteleft/quoteright/quotesinglbase/trademark/fi/fl/Lslash/OE/Scaron/Ydieresis/Zcaron/dotlessi/lslash/oe/scaron/zcaron
 164/currency 166/brokenbar 168/dieresis/copyright/ordfeminine 172/logicalnot/.notdef/registered/macron/degree/plusminus/twosuperior/threesuperior/acute/mu
@@ -92,12 +92,12 @@ endobj
 <</Type/Font/Subtype/Type1/Name/ZaDb/BaseFont/ZapfDingbats>>
 endobj
 6 0 obj
-<</Type/Font/Subtype/Type1/Name/Helv/BaseFont/Helvetica/Encoding 11 0 R>>
+<</Type/Font/Subtype/Type1/Name/Helv/BaseFont/Helvetica/Encoding 30 0 R>>
 endobj
 4 0 obj
 <</Type/Annot/Subtype/Widget/F 4/P 3 0 R/T<feff0074006500780074>/FT/Tx/Q 0/BS<</W
-1/S/S>>/MK<</BC[1 0 0]/BG[1 1 1]>>/DA(/Helv 10 Tf)/DV()/V()/Rect[200.538 695.17 285.577
-707.125]>>
+1/S/S>>/MK<</BC[1 0 0]/BG[1 1 1]>>/DA(/Helv 10 Tf)/DV()/V()/Rect[200.538 705.133
+285.577 717.088]>>
 endobj
 8 0 obj
 [4 0 R]
@@ -147,7 +147,7 @@ endobj
 <</Subtype/Type1C/Length 756>>
 [BINARY STREAM]
 endobj
-13 0 obj
+12 0 obj
 <</Type/Font/Subtype/Type1/Widths 41 0 R/FirstChar 51/LastChar 123/BaseFont/POGXIQ+Dingbats/FontDescriptor
 43 0 R>>
 endobj
@@ -230,7 +230,7 @@ endobj
 <</Length 14>>
 [BINARY STREAM]
 endobj
-26 0 obj
+25 0 obj
 <</Type/Font/Subtype/CIDFontType0/BaseFont/EXQIVM+LMSans10-Regular/CIDSystemInfo<</Registry(Adobe)/Ordering(Identity)/Supplement
 0>>/FontDescriptor 46 0 R/DW 280/W 48 0 R>>
 endobj
@@ -259,8 +259,8 @@ endobj
 -290 1417 1127]/ItalicAngle 0/Flags 6/Style<</Panose<000000000500000000000000>>>/FontName/XUUPUX+LMRoman10-Regular/FontFile3
 51 0 R/CIDSet 53 0 R>>
 endobj
-27 0 obj
-<</Type/Font/Subtype/Type0/BaseFont/EXQIVM+LMSans10-Regular-Identity-H/Encoding/Identity-H/DescendantFonts[26 0 R]/ToUnicode
+26 0 obj
+<</Type/Font/Subtype/Type0/BaseFont/EXQIVM+LMSans10-Regular-Identity-H/Encoding/Identity-H/DescendantFonts[25 0 R]/ToUnicode
 44 0 R>>
 endobj
 32 0 obj
@@ -270,62 +270,62 @@ endobj
 xref
 0 54
 0000000000 65535 f 
-0000005135 00000 n 
-0000005005 00000 n 
-0000004833 00000 n 
-0000004266 00000 n 
-0000004101 00000 n 
-0000004177 00000 n 
-0000004485 00000 n 
-0000004462 00000 n 
-0000004527 00000 n 
-0000004558 00000 n 
-0000002918 00000 n 
+0000005063 00000 n 
+0000004933 00000 n 
+0000004761 00000 n 
+0000004193 00000 n 
+0000004028 00000 n 
+0000004104 00000 n 
+0000004413 00000 n 
+0000004390 00000 n 
+0000004455 00000 n 
+0000004486 00000 n 
 0000000160 00000 n 
-0000006242 00000 n 
-0000002834 00000 n 
-0000002876 00000 n 
-0000002897 00000 n 
-0000002855 00000 n 
+0000006170 00000 n 
+0000002761 00000 n 
+0000002803 00000 n 
+0000002824 00000 n 
+0000002782 00000 n 
 0000000015 00000 n 
-0000000509 00000 n 
-0000000383 00000 n 
-0000000831 00000 n 
-0000000686 00000 n 
-0000001180 00000 n 
-0000001054 00000 n 
-0000001502 00000 n 
-0000008802 00000 n 
-0000011463 00000 n 
-0000001357 00000 n 
-0000002089 00000 n 
-0000001944 00000 n 
-0000011012 00000 n 
-0000011613 00000 n 
-0000002535 00000 n 
-0000002754 00000 n 
-0000004681 00000 n 
-0000004728 00000 n 
-0000004621 00000 n 
-0000004775 00000 n 
-0000004925 00000 n 
-0000004809 00000 n 
-0000005253 00000 n 
-0000005421 00000 n 
-0000006374 00000 n 
-0000006562 00000 n 
-0000007051 00000 n 
-0000008991 00000 n 
-0000007569 00000 n 
-0000008669 00000 n 
-0000008739 00000 n 
-0000011202 00000 n 
-0000009251 00000 n 
-0000010867 00000 n 
-0000010948 00000 n 
+0000000485 00000 n 
+0000000359 00000 n 
+0000000799 00000 n 
+0000000654 00000 n 
+0000001139 00000 n 
+0000001013 00000 n 
+0000001456 00000 n 
+0000008730 00000 n 
+0000011391 00000 n 
+0000001311 00000 n 
+0000002032 00000 n 
+0000001887 00000 n 
+0000002845 00000 n 
+0000010940 00000 n 
+0000011541 00000 n 
+0000002461 00000 n 
+0000002681 00000 n 
+0000004609 00000 n 
+0000004656 00000 n 
+0000004549 00000 n 
+0000004703 00000 n 
+0000004853 00000 n 
+0000004737 00000 n 
+0000005181 00000 n 
+0000005349 00000 n 
+0000006302 00000 n 
+0000006490 00000 n 
+0000006979 00000 n 
+0000008919 00000 n 
+0000007497 00000 n 
+0000008597 00000 n 
+0000008667 00000 n 
+0000011130 00000 n 
+0000009179 00000 n 
+0000010795 00000 n 
+0000010876 00000 n 
 trailer
 <</Root 1 0 R/Info 2 0 R/ID[<ID-STRING><ID-STRING>]/Size
 54>>
 startxref
-11764
+11692
 %%EOF
diff --git a/testfiles/xform-preamble.luatex.tpf b/testfiles/xform-preamble.luatex.tpf
new file mode 100644
index 0000000..b08b261
--- /dev/null
+++ b/testfiles/xform-preamble.luatex.tpf
@@ -0,0 +1,137 @@
+%PDF-1.5
+%ÌÕÁÔÅØÐÄÆ
+5 0 obj
+<< /Type /XObject /Subtype /Form /FormType 1 /yyy (bla) /BBox [ 0 0 26.301 6.336 ] /Matrix [ 1 0 0 1 0 0 ] /Resources 6 0 R /Length 68 >>         
+stream
+BT
+/F25 9.96264 Tf
+1 0 0 1 0 2.042 Tm [<00760076007600760076>]TJ
+ET
+endstream
+endobj
+6 0 obj
+<< /Font << /F25 7 0 R >> /ProcSet [ /PDF /Text ] >>
+endobj
+10 0 obj
+<< /Length 243 >>        
+stream
+BT
+/F25 9.96264 Tf
+1 0 0 1 148.712 707.125 Tm [<0069003200740069>]TJ
+ET
+q
+1 0 0 1 169.464 705.083 cm
+/Fm1 Do
+Q
+BT
+/F25 9.96264 Tf
+1 0 0 1 195.766 707.125 Tm [<00620051004B0032>-333<0069003200740069>]TJ
+1 0 0 1 303.133 139.255 Tm [<0052>]TJ
+ET
+endstream
+endobj
+9 0 obj
+<< /Type /Page /Contents 10 0 R /Resources 8 0 R /MediaBox [ 0 0 595.276 841.89 ] /Parent 11 0 R >>
+endobj
+8 0 obj
+<< /Font << /F25 7 0 R >> /XObject << /Fm1 5 0 R >> /ProcSet [ /PDF /Text ] >>
+endobj
+12 0 obj
+[ 50 [ 444 ] 75 [ 833 ] 81 [ 500 500 ] 98 [ 394 ] 105 [ 389 ] 116 [ 528 ] 118 [ 528 ] ]
+endobj
+14 0 obj
+<< /Length 15 >>         
+[BINARY STREAM]
+endobj
+15 0 obj
+<< /Subtype /CIDFontType0C /Length 1560 >>       
+[BINARY STREAM]
+endobj
+13 0 obj
+<< /Type /FontDescriptor /FontName /SWPJQI+LMRoman10-Regular /Flags 4 /FontBBox [ -430 -290 1417 1127 ] /Ascent 1127 /CapHeight 683 /Descent -290 /ItalicAngle 0 /StemV 93 /XHeight 431 /FontFile3 15 0 R /CIDSet 14 0 R >>
+endobj
+16 0 obj
+<< /Length 790 >>        
+stream
+%!PS-Adobe-3.0 Resource-CMap
+%%DocumentNeededResources: ProcSet (CIDInit)
+%%IncludeResource: ProcSet (CIDInit)
+%%BeginResource: CMap (TeX-SWPJQI-LMRoman10-Regular-0)
+%%Title: (TeX-SWPJQI-LMRoman10-Regular-0 TeX SWPJQI-LMRoman10-Regular 0)
+%%Version: 1.000
+%%EndComments
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CIDSystemInfo
+<< /Registry (TeX)
+/Ordering (SWPJQI-LMRoman10-Regular)
+/Supplement 0
+>> def
+/CMapName /TeX-Identity-SWPJQI-LMRoman10-Regular def
+/CMapType 2 def
+1 begincodespacerange
+<0000> <FFFF>
+endcodespacerange
+0 beginbfrange
+endbfrange
+8 beginbfchar
+<0032> <0065>
+<004B> <006D>
+<0051> <006F>
+<0052> <0031>
+<0062> <0073>
+<0069> <0074>
+<0074> <0078>
+<0076> <0079>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+%%EndResource
+%%EOF
+endstream
+endobj
+7 0 obj
+<< /Type /Font /Subtype /Type0 /Encoding /Identity-H /BaseFont /SWPJQI+LMRoman10-Regular /DescendantFonts [ 17 0 R ] /ToUnicode 16 0 R >>
+endobj
+17 0 obj
+<< /Type /Font /Subtype /CIDFontType0 /BaseFont /SWPJQI+LMRoman10-Regular /FontDescriptor 13 0 R /W 12 0 R /CIDSystemInfo << /Registry (Adobe) /Ordering (Identity) /Supplement 0 >> >>
+endobj
+11 0 obj
+<< /Type /Pages  /Count 1 /Kids [ 9 0 R ] >>
+endobj
+18 0 obj
+<< /Type /Catalog /Pages 11 0 R >>
+endobj
+19 0 obj
+<< /Producer (LuaTeX) /Creator (TeX) /Trapped /False >>
+endobj
+xref
+0 20
+0000000001 65535 f 
+0000000002 00000 f 
+0000000003 00000 f 
+0000000004 00000 f 
+0000000000 00000 f 
+0000000020 00000 n 
+0000000268 00000 n 
+0000003757 00000 n 
+0000000754 00000 n 
+0000000639 00000 n 
+0000000336 00000 n 
+0000004110 00000 n 
+0000000848 00000 n 
+0000002671 00000 n 
+0000000952 00000 n 
+0000001027 00000 n 
+0000002907 00000 n 
+0000003910 00000 n 
+0000004171 00000 n 
+0000004222 00000 n 
+trailer
+<< /Size 20 /Root 18 0 R /Info 19 0 R >>
+startxref
+4294
+%%EOF
diff --git a/testfiles/xform-preamble.pvt b/testfiles/xform-preamble.pvt
new file mode 100644
index 0000000..f031215
--- /dev/null
+++ b/testfiles/xform-preamble.pvt
@@ -0,0 +1,14 @@
+\input{regression-test}
+\documentclass{article}
+\usepackage{pdfresources}
+\ExplSyntaxOn
+\pdf_xform_new:nnn  {myxformA}{/yyy~(bla)}{yyyyy}
+\ExplSyntaxOff
+\begin{document}
+\START
+text
+\ExplSyntaxOn
+\pdf_xform_use:n {myxformA}
+some~text~
+\ExplSyntaxOff
+\end{document} 
\ No newline at end of file
diff --git a/testfiles/catalogAF.tpf b/testfiles/xform-preamble.tpf
similarity index 53%
copy from testfiles/catalogAF.tpf
copy to testfiles/xform-preamble.tpf
index b755025..3b84acb 100644
--- a/testfiles/catalogAF.tpf
+++ b/testfiles/xform-preamble.tpf
@@ -1,55 +1,78 @@
-%PDF-2.0
+%PDF-1.5
 %ÐÔÅØ
 5 0 obj
-<< /Type/Filespec/UF(example1.pdf) >>
+<<
+/Type /XObject
+/Subtype /Form
+/yyy (bla)
+/BBox [0 0 26.29 6.227]
+/FormType 1
+/Matrix [1 0 0 1 0 0]
+/Resources 6 0 R
+/Length 62        
+>>
+stream
+1 0 0 1 0 6.227 cm
+BT
+/F8 9.9626 Tf 0 -4.29 Td [(yyyyy)]TJ
+ET
+endstream
 endobj
 6 0 obj
-<< /Type/Filespec/UF(example2.pdf) >>
+<<
+/Font << /F8 7 0 R >>
+/ProcSet [ /PDF /Text ]
+>>
 endobj
-9 0 obj
+10 0 obj
 <<
-/Length 91        
+/Length 180       
 >>
 stream
 BT
-/F8 9.9626 Tf 148.712 707.125 Td [(some)-333(te)-1(xt)]TJ 154.421 -567.87 Td [(1)]TJ
+/F8 9.9626 Tf 148.712 707.125 Td [(text)]TJ
+ET
+q
+1 0 0 1 169.468 705.188 cm
+/Fm1 Do
+Q
+BT
+/F8 9.9626 Tf 195.758 707.125 Td [(some)-333(te)-1(xt)]TJ 107.375 -567.87 Td [(1)]TJ
 ET
 endstream
 endobj
-8 0 obj
+9 0 obj
 <<
 /Type /Page
-/Contents 9 0 R
-/Resources 7 0 R
+/Contents 10 0 R
+/Resources 8 0 R
 /MediaBox [0 0 595.276 841.89]
 /Parent 11 0 R
 >>
 endobj
-7 0 obj
+8 0 obj
 <<
-/Font << /F8 10 0 R >>
+/Font << /F8 7 0 R >>
+/XObject << /Fm1 5 0 R >>
 /ProcSet [ /PDF /Text ]
 >>
 endobj
 12 0 obj
-[ 5 0 R 6 0 R ]
+[500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8 472.2 472.2 777.8 750 708.3 722.2 763.9 680.6 652.8 784.7 750 361.1 513.9 777.8 625 916.7 750 777.8 680.6 777.8 736.1 555.6 722.2 750 750 1027.8 750 750 611.1 277.8 500 277.8 500 277.8 277.8 500 555.6 444.4 555.6 444.4 305.6 500 555.6 277.8 305.6 527.8 277.8 833.3 555.6 500 555.6 527.8 391.7 394.4 388.9 555.6 527.8 722.2 527.8 527.8]
 endobj
 13 0 obj
-[500 500 500 500 500 500 500 500 500 277.8 277.8 277.8 777.8 472.2 472.2 777.8 750 708.3 722.2 763.9 680.6 652.8 784.7 750 361.1 513.9 777.8 625 916.7 750 777.8 680.6 777.8 736.1 555.6 722.2 750 750 1027.8 750 750 611.1 277.8 500 277.8 500 277.8 277.8 500 555.6 444.4 555.6 444.4 305.6 500 555.6 277.8 305.6 527.8 277.8 833.3 555.6 500 555.6 527.8 391.7 394.4 388.9 555.6 527.8 722.2 527.8]
-endobj
-14 0 obj
 <<
-/Length1 1455
-/Length2 9286
+/Length1 1470
+/Length2 9530
 /Length3 0
-/Length 10741     
+/Length 11000     
 >>
 [BINARY STREAM]
 endobj
-15 0 obj
+14 0 obj
 <<
 /Type /FontDescriptor
-/FontName /CTWJDN+CMR10
+/FontName /ICAEIU+CMR10
 /Flags 4
 /FontBBox [-40 -250 1009 750]
 /Ascent 694
@@ -58,36 +81,35 @@ endobj
 /ItalicAngle 0
 /StemV 69
 /XHeight 431
-/CharSet (/e/m/o/one/s/t/x)
-/FontFile 14 0 R
+/CharSet (/e/m/o/one/s/t/x/y)
+/FontFile 13 0 R
 >>
 endobj
-10 0 obj
+7 0 obj
 <<
 /Type /Font
 /Subtype /Type1
-/BaseFont /CTWJDN+CMR10
-/FontDescriptor 15 0 R
+/BaseFont /ICAEIU+CMR10
+/FontDescriptor 14 0 R
 /FirstChar 49
-/LastChar 120
-/Widths 13 0 R
+/LastChar 121
+/Widths 12 0 R
 >>
 endobj
 11 0 obj
 <<
 /Type /Pages
 /Count 1
-/Kids [8 0 R]
+/Kids [9 0 R]
 >>
 endobj
-16 0 obj
+15 0 obj
 <<
 /Type /Catalog
 /Pages 11 0 R
-/AF 12 0 R/Lang (de-DE)
 >>
 endobj
-17 0 obj
+16 0 obj
 <<
 /Producer (pdfTeX)
 /Creator (TeX)
@@ -95,30 +117,29 @@ endobj
 >>
 endobj
 xref
-0 18
+0 17
 0000000001 65535 f 
 0000000002 00000 f 
 0000000003 00000 f 
 0000000004 00000 f 
 0000000000 00000 f 
 0000000015 00000 n 
-0000000068 00000 n 
-0000000382 00000 n 
-0000000270 00000 n 
-0000000121 00000 n 
-0000011959 00000 n 
-0000012099 00000 n 
-0000000450 00000 n 
-0000000482 00000 n 
-0000000889 00000 n 
-0000011728 00000 n 
-0000012157 00000 n 
-0000012232 00000 n 
+0000000251 00000 n 
+0000012507 00000 n 
+0000000670 00000 n 
+0000000557 00000 n 
+0000000318 00000 n 
+0000012646 00000 n 
+0000000763 00000 n 
+0000001176 00000 n 
+0000012274 00000 n 
+0000012704 00000 n 
+0000012755 00000 n 
 trailer
-<< /Size 18
-/Root 16 0 R
-/Info 17 0 R
+<< /Size 17
+/Root 15 0 R
+/Info 16 0 R
  >>
 startxref
-12304
+12827
 %%EOF
diff --git a/testfiles/xform-preamble.xetex.tpf b/testfiles/xform-preamble.xetex.tpf
new file mode 100644
index 0000000..87f8077
--- /dev/null
+++ b/testfiles/xform-preamble.xetex.tpf
@@ -0,0 +1,129 @@
+%PDF-1.5
+%äðíø
+11 0 obj
+<</Font<</F1 6 0 R>>/ExtGState 7 0 R/Pattern 8 0 R/Shading 9 0 R/ColorSpace 10 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+endobj
+4 0 obj
+<</Type/XObject/Subtype/Form/FormType 1/BBox[-72 69.958 -45.699 76.294]/Matrix[1
+0 0 1 72 -72]/yyy(bla)/Resources 11 0 R/Length 64>>
+stream
+ 0 G 0 g BT /F1 9.9626 Tf -72 72 Td[<00760076007600760076>]TJ ET
+endstream
+endobj
+12 0 obj
+<</Length 236>>
+stream
+ q 1 0 0 1 72 769.89 cm BT /F1 9.9626 Tf 76.712 -62.765 Td[<0069003200740069>]TJ ET q 1 0 0 1 97.465 -62.765 cm /Fm0 Do Q BT /F1 9.9626 Tf 123.766 -62.765 Td[<00620051004b0032>-332<0069003200740069>]TJ 107.367 -567.87 Td[<0052>]TJ ET Q
+endstream
+endobj
+13 0 obj
+<</Font<</F1 6 0 R>>/XObject<</Fm0 4 0 R>>/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+endobj
+7 0 obj
+<<>>
+endobj
+10 0 obj
+<<>>
+endobj
+8 0 obj
+<<>>
+endobj
+9 0 obj
+<<>>
+endobj
+3 0 obj
+<</Resources 13 0 R/Type/Page/Parent 14 0 R/Contents[12 0 R]>>
+endobj
+14 0 obj
+<</Type/Pages/Count 1/Kids[3 0 R]/MediaBox[0 0 595.28 841.89]>>
+endobj
+2 0 obj
+<</Creator(TeX)/Producer(xdvipdfmx)/CreationDate(D:20160520090000-00'00')>>
+endobj
+1 0 obj
+<</Pages 14 0 R/Type/Catalog>>
+endobj
+15 0 obj
+<</Length 454>>
+stream
+/CIDInit /ProcSet findresource begin
+12 dict begin
+begincmap
+/CMapName /EXQIVM+LMRoman10-Regular-UTF16 def
+/CMapType 2 def
+/CIDSystemInfo <<
+  /Registry (Adobe)
+  /Ordering (UCS)
+  /Supplement 0
+>> def
+1 begincodespacerange
+<0000> <FFFF>
+endcodespacerange
+8 beginbfchar
+<0032> <0065>
+<004B> <006D>
+<0051> <006F>
+<0052> <0031>
+<0062> <0073>
+<0069> <0074>
+<0074> <0078>
+<0076> <0079>
+endbfchar
+endcmap
+CMapName currentdict /CMap defineresource pop
+end
+end
+endstream
+endobj
+17 0 obj
+<</Subtype/CIDFontType0C/Length 1534>>
+[BINARY STREAM]
+endobj
+18 0 obj
+[50[444]75[833]81[500 500]98[394]105[389]116[528]118[528]]
+endobj
+19 0 obj
+<</Length 15>>
+[BINARY STREAM]
+endobj
+5 0 obj
+<</Type/Font/Subtype/CIDFontType0/BaseFont/EXQIVM+LMRoman10-Regular/CIDSystemInfo<</Registry(Adobe)/Ordering(Identity)/Supplement
+0>>/FontDescriptor 16 0 R/DW 280/W 18 0 R>>
+endobj
+16 0 obj
+<</Type/FontDescriptor/Ascent 806/Descent -194/StemV 69/CapHeight 806/AvgWidth 549/FontBBox[-430
+-290 1417 1127]/ItalicAngle 0/Flags 6/Style<</Panose<000000000500000000000000>>>/FontName/EXQIVM+LMRoman10-Regular/FontFile3
+17 0 R/CIDSet 19 0 R>>
+endobj
+6 0 obj
+<</Type/Font/Subtype/Type0/BaseFont/EXQIVM+LMRoman10-Regular-Identity-H/Encoding/Identity-H/DescendantFonts[5 0 R]/ToUnicode
+15 0 R>>
+endobj
+xref
+0 20
+0000000000 65535 f 
+0000001103 00000 n 
+0000001012 00000 n 
+0000000854 00000 n 
+0000000156 00000 n 
+0000003399 00000 n 
+0000003849 00000 n 
+0000000773 00000 n 
+0000000814 00000 n 
+0000000834 00000 n 
+0000000793 00000 n 
+0000000015 00000 n 
+0000000386 00000 n 
+0000000672 00000 n 
+0000000932 00000 n 
+0000001149 00000 n 
+0000003588 00000 n 
+0000001653 00000 n 
+0000003260 00000 n 
+0000003335 00000 n 
+trailer
+<</Root 1 0 R/Info 2 0 R/ID[<ID-STRING><ID-STRING>]/Size
+20>>
+startxref
+3998
+%%EOF
diff --git a/testfiles/xform.xetex.tpf b/testfiles/xform.xetex.tpf
index a8c3e3b..67df3eb 100644
--- a/testfiles/xform.xetex.tpf
+++ b/testfiles/xform.xetex.tpf
@@ -1,23 +1,23 @@
 %PDF-1.5
 %äðíø
 11 0 obj
-<</Font<</F1 6 0 R>>/ExtGState 4 0 R/Pattern 8 0 R/Shading 9 0 R/ColorSpace 10 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+<</Font<</F1 7 0 R>>/ExtGState 4 0 R/Pattern 8 0 R/Shading 9 0 R/ColorSpace 10 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
 endobj
-7 0 obj
-<</Type/XObject/Subtype/Form/FormType 1/BBox[97.465 -64.807 123.766 -58.471]/Matrix[1
-0 0 1 -97.465 62.765]/yyy(bla)/Resources 11 0 R/Length 72>>
+5 0 obj
+<</Type/XObject/Subtype/Form/FormType 1/BBox[-72 69.958 -45.699 76.294]/Matrix[1
+0 0 1 72 -72]/yyy(bla)/Resources 11 0 R/Length 64>>
 stream
- 0 G 0 g BT /F1 9.9626 Tf 97.465 -62.765 Td[<00760076007600760076>]TJ ET
+ 0 G 0 g BT /F1 9.9626 Tf -72 72 Td[<00760076007600760076>]TJ ET
 endstream
 endobj
 13 0 obj
-<</Font<</F1 6 0 R>>/ExtGState 4 0 R/Pattern 8 0 R/Shading 9 0 R/ColorSpace 10 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+<</Font<</F1 7 0 R>>/ExtGState 4 0 R/Pattern 8 0 R/Shading 9 0 R/ColorSpace 10 0 R/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
 endobj
 12 0 obj
-<</Type/XObject/Subtype/Form/FormType 1/BBox[97.465 -62.765 150.067 -58.471]/Matrix[1
-0 0 1 -97.465 62.765]/yyy(bla)/Resources 13 0 R/Length 92>>
+<</Type/XObject/Subtype/Form/FormType 1/BBox[-72 72 -19.397 76.294]/Matrix[1 0 0
+1 72 -72]/yyy(bla)/Resources 13 0 R/Length 84>>
 stream
- 0 G 0 g BT /F1 9.9626 Tf 97.465 -62.765 Td[<0074007400740074007400740074007400740074>]TJ ET
+ 0 G 0 g BT /F1 9.9626 Tf -72 72 Td[<0074007400740074007400740074007400740074>]TJ ET
 endstream
 endobj
 14 0 obj
@@ -27,7 +27,7 @@ stream
 endstream
 endobj
 15 0 obj
-<</ExtGState 4 0 R/Font<</F1 6 0 R>>/XObject<</Fm1 12 0 R/Fm0 7 0 R>>/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
+<</ExtGState 4 0 R/Font<</F1 7 0 R>>/XObject<</Fm1 12 0 R/Fm0 5 0 R>>/ProcSet[/PDF/Text/ImageC/ImageB/ImageI]>>
 endobj
 4 0 obj
 <</bearopacity<</ca .7/CA .7>>>>
@@ -103,7 +103,7 @@ endobj
 <</Length 15>>
 [BINARY STREAM]
 endobj
-5 0 obj
+6 0 obj
 <</Type/Font/Subtype/CIDFontType0/BaseFont/EXQIVM+LMRoman10-Regular/CIDSystemInfo<</Registry(Adobe)/Ordering(Identity)/Supplement
 0>>/FontDescriptor 18 0 R/DW 280/W 20 0 R>>
 endobj
@@ -112,37 +112,37 @@ endobj
 -290 1417 1127]/ItalicAngle 0/Flags 6/Style<</Panose<000000000500000000000000>>>/FontName/EXQIVM+LMRoman10-Regular/FontFile3
 19 0 R/CIDSet 21 0 R>>
 endobj
-6 0 obj
-<</Type/Font/Subtype/Type0/BaseFont/EXQIVM+LMRoman10-Regular-Identity-H/Encoding/Identity-H/DescendantFonts[5 0 R]/ToUnicode
+7 0 obj
+<</Type/Font/Subtype/Type0/BaseFont/EXQIVM+LMRoman10-Regular-Identity-H/Encoding/Identity-H/DescendantFonts[6 0 R]/ToUnicode
 17 0 R>>
 endobj
 xref
 0 22
 0000000000 65535 f 
-0000001764 00000 n 
-0000001673 00000 n 
-0000001515 00000 n 
-0000001406 00000 n 
-0000005103 00000 n 
-0000005553 00000 n 
+0000001718 00000 n 
+0000001627 00000 n 
+0000001469 00000 n 
+0000001360 00000 n 
 0000000156 00000 n 
-0000001475 00000 n 
-0000001495 00000 n 
-0000001454 00000 n 
+0000005057 00000 n 
+0000005507 00000 n 
+0000001429 00000 n 
+0000001449 00000 n 
+0000001408 00000 n 
 0000000015 00000 n 
-0000000548 00000 n 
-0000000407 00000 n 
-0000000820 00000 n 
-0000001278 00000 n 
-0000001593 00000 n 
-0000001810 00000 n 
-0000005292 00000 n 
-0000002413 00000 n 
-0000004914 00000 n 
-0000005039 00000 n 
+0000000527 00000 n 
+0000000386 00000 n 
+0000000774 00000 n 
+0000001232 00000 n 
+0000001547 00000 n 
+0000001764 00000 n 
+0000005246 00000 n 
+0000002367 00000 n 
+0000004868 00000 n 
+0000004993 00000 n 
 trailer
 <</Root 1 0 R/Info 2 0 R/ID[<ID-STRING><ID-STRING>]/Size
 22>>
 startxref
-5702
+5656
 %%EOF





More information about the latex3-commits mailing list.