[latex3-commits] [latex3/latex3] main: Add a test for box use in drawing scope (e75b44a53)

github at latex-project.org github at latex-project.org
Tue Mar 12 09:19:36 CET 2024


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/e75b44a5383959d9efe448f05b0e7d824aa5e943

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

commit e75b44a5383959d9efe448f05b0e7d824aa5e943
Author: Joseph Wright <joseph at texdev.net>
Date:   Tue Mar 12 07:29:23 2024 +0000

    Add a test for box use in drawing scope
    
    Includes testing that changes before the box are
    applied after, etc.


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

e75b44a5383959d9efe448f05b0e7d824aa5e943
 .../l3draw/testfiles/m3draw006.etex-dvips.tlg      | 78 ++++++++++++++++++++++
 .../l3draw/testfiles/m3draw006.etex-dvisvgm.tlg    | 50 ++++++++++++++
 l3experimental/l3draw/testfiles/m3draw006.lvt      | 16 +++++
 l3experimental/l3draw/testfiles/m3draw006.tlg      | 48 +++++++++++++
 .../l3draw/testfiles/m3draw006.uptex.tlg           | 78 ++++++++++++++++++++++
 .../l3draw/testfiles/m3draw006.xetex.tlg           | 49 ++++++++++++++
 6 files changed, 319 insertions(+)

diff --git a/l3experimental/l3draw/testfiles/m3draw006.etex-dvips.tlg b/l3experimental/l3draw/testfiles/m3draw006.etex-dvips.tlg
index 07776cb90..7c3cfbb81 100644
--- a/l3experimental/l3draw/testfiles/m3draw006.etex-dvips.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw006.etex-dvips.tlg
@@ -310,6 +310,84 @@ l. ...  }
 ! OK.
 <argument> \l_tmpa_box 
 l. ...  }
+> \box...=
+\hbox(142.66377+0.0)x284.92755
+.\hbox(142.66377+0.0)x284.92755
+..\glue 0.2
+..\hbox(0.0+0.0)x0.0, shifted -0.2
+...\special{ps::[begin]}
+...\special{ps::/draw.x currentpoint /draw.y exch def def}
+...\special{ps::@beginspecial}
+...\special{ps::0.39851 setlinewidth}
+...\special{color push gray 0}
+...\special{ps:SDict begin /color.sc {} def end}
+...\special{ps::0 setlinecap}
+...\special{ps::0 setlinejoin}
+...\special{ps::10 setmiterlimit}
+...\special{ps::[] 0 setdash}
+...\hbox(0.0+0.0)x0.0
+....\special{ps::0 0 moveto}
+....\special{ps::283.46457 0 lineto}
+....\special{ps::141.73228 0 moveto}
+....\special{ps::141.73228 141.73228 lineto}
+....\special{ps::gsave}
+....\special{ps::color.sc}
+....\special{ps::stroke}
+....\special{ps::grestore}
+....\special{ps::newpath}
+....\special{color push rgb 1.0 0.0 0.0}
+....\special{ps:SDict begin /color.sc {} def end}
+....\special{ps::save}
+....\special{color push rgb 0.0 0.0 1.0}
+....\special{ps:SDict begin /color.sc {} def end}
+....\hbox(0.0+0.0)x0.0
+.....\kern 0.0
+.....\hbox(6.94444+0.0)x0.0
+......\special{ps::save}
+......\special{ps::72 Resolution div 72 VResolution div neg scale}
+......\special{ps::magscale{1 DVImag div dup scale}if}
+......\special{ps::draw.x neg draw.y neg translate}
+......\special{ps::[end]}
+......\special{ps::[begin]}
+......\special{ps::save}
+......\special{ps::currentpoint}
+......\special{ps::currentpoint translate}
+......\special{ps::[1 0 0 -1 0 0] concat}
+......\special{ps::[1 0 0 1 0 0] concat}
+......\special{ps::[1 0 0 -1 0 0] concat}
+......\special{ps::neg exch neg exch translate}
+......\special{ps::[end]}
+......\hbox(6.94444+0.0)x0.0, glue set - 22.50005fil
+.......\hbox(6.94444+0.0)x22.50005
+........\OT1/cmr/m/n/10 H
+........\OT1/cmr/m/n/10 e
+........\OT1/cmr/m/n/10 l
+........\OT1/cmr/m/n/10 l
+........\OT1/cmr/m/n/10 o
+.......\glue 0.0 plus 1.0fil minus 1.0fil
+......\special{ps::[begin]}
+......\special{ps::restore}
+......\special{ps::[end]}
+......\special{ps::[begin]}
+......\special{ps::restore}
+....\special{color pop}
+....\special{ps::restore}
+....\special{ps::0 0 moveto}
+....\special{ps::141.73228 0 lineto}
+....\special{ps::70.86615 0 moveto}
+....\special{ps::70.86615 70.86615 lineto}
+....\special{ps::gsave}
+....\special{ps::color.sc}
+....\special{ps::stroke}
+....\special{ps::grestore}
+....\special{ps::newpath}
+....\special{color pop}
+...\special{ps::@endspecial}
+...\special{ps::[end]}
+...\special{color pop}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
 ============================================================
 ============================================================
 TEST 2: \draw_coffin_use:Nnn (n)
diff --git a/l3experimental/l3draw/testfiles/m3draw006.etex-dvisvgm.tlg b/l3experimental/l3draw/testfiles/m3draw006.etex-dvisvgm.tlg
index 48dddc1cd..536efde1f 100644
--- a/l3experimental/l3draw/testfiles/m3draw006.etex-dvisvgm.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw006.etex-dvisvgm.tlg
@@ -220,6 +220,56 @@ l. ...  }
 ! OK.
 <argument> \l_tmpa_box 
 l. ...  }
+> \box...=
+\hbox(142.66377+0.0)x284.92755
+.\hbox(142.66377+0.0)x284.92755
+..\glue 0.2
+..\hbox(0.0+0.0)x0.0, shifted -0.2
+...\special{dvisvgm:raw <g>{?nl}}
+...\special{dvisvgm:raw <g transform="translate({?x},{?y}) scale(1,-1)">{?nl}}
+...\special{dvisvgm:raw <g stroke-width="0.4">{?nl}}
+...\special{color push gray 0}
+...\special{dvisvgm:raw <g fill-rule="nonzero">{?nl}}
+...\special{dvisvgm:raw <g stroke-linecap="butt">{?nl}}
+...\special{dvisvgm:raw <g stroke-linejoin="miter">{?nl}}
+...\special{dvisvgm:raw <g stroke-miterlimit="10">{?nl}}
+...\special{dvisvgm:raw <g stroke-dasharray="none" stroke-offset="0">{?nl}}
+...\hbox(0.0+0.0)x0.0
+....\special{dvisvgm:raw <path d="M 0 0 L 284.52756 0 M 142.26378 0 L 142.26378 142.26378" style="fill:none"/>{?nl}}
+....\special{color push rgb 1.0 0.0 0.0}
+....\special{dvisvgm:raw <g>{?nl}}
+....\special{color push rgb 0.0 0.0 1.0}
+....\hbox(0.0+0.0)x0.0
+.....\kern 0.0
+.....\hbox(0.0+0.0)x0.0
+......\special{dvisvgm:raw <g>{?nl}}
+......\special{dvisvgm:raw <g transform="matrix(1,0,0,1,0pt,0pt)">{?nl}}
+......\special{dvisvgm:raw <g stroke="none" transform="scale(-1,1) translate({?x},{?y}) scale(-1,-1)">{?nl}}
+......\hbox(0.0+0.0)x0.0
+.......\OT1/cmr/m/n/10 H
+.......\OT1/cmr/m/n/10 e
+.......\OT1/cmr/m/n/10 l
+.......\OT1/cmr/m/n/10 l
+.......\OT1/cmr/m/n/10 o
+......\special{dvisvgm:raw </g>{?nl}}
+......\special{dvisvgm:raw </g>{?nl}}
+......\special{dvisvgm:raw </g>{?nl}}
+....\special{color pop}
+....\special{dvisvgm:raw </g>{?nl}}
+....\special{dvisvgm:raw <path d="M 0 0 L 142.26378 0 M 71.1319 0 L 71.1319 71.1319" style="fill:none"/>{?nl}}
+....\special{color pop}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{dvisvgm:raw </g>{?nl}}
+...\special{color pop}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
 ============================================================
 ============================================================
 TEST 2: \draw_coffin_use:Nnn (n)
diff --git a/l3experimental/l3draw/testfiles/m3draw006.lvt b/l3experimental/l3draw/testfiles/m3draw006.lvt
index e865efeca..6e31859bd 100644
--- a/l3experimental/l3draw/testfiles/m3draw006.lvt
+++ b/l3experimental/l3draw/testfiles/m3draw006.lvt
@@ -62,6 +62,22 @@
         \hbox_set:Nn \l_tmpb_box { Hello }
         \draw_box_use:Nn \l_tmpb_box { 2cm , 2cm }
       }
+    \test:n
+      {
+        \draw_transform_matrix_absolute:nnnn { 0.5 } { 0 } { 0 } { 0.5 }
+        \color_select:n { red }
+        \draw_scope_begin:
+        \color_select:n { blue }
+        \draw_transform_matrix_reset:
+        \hbox_set:Nn \l_tmpb_box { Hello }
+        \draw_box_use:N \l_tmpb_box
+        \draw_scope_end:
+        \draw_path_moveto:n { 0cm, 0cm }
+        \draw_path_lineto:n { 10cm, 0cm }
+        \draw_path_moveto:n { 5cm, 0cm }
+        \draw_path_lineto:n { 5cm , 5cm }
+        \draw_path_use_clear:n { stroke }
+      }
   }
 
 \TEST { \draw_coffin_use:Nnn(n) }
diff --git a/l3experimental/l3draw/testfiles/m3draw006.tlg b/l3experimental/l3draw/testfiles/m3draw006.tlg
index 1982ff0b1..316130069 100644
--- a/l3experimental/l3draw/testfiles/m3draw006.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw006.tlg
@@ -190,6 +190,54 @@ l. ...  }
 ! OK.
 <argument> \l_tmpa_box 
 l. ...  }
+> \box...=
+\hbox(142.66377+0.0)x284.92755
+.\hbox(142.66377+0.0)x284.92755
+..\glue 0.2
+..\hbox(0.0+0.0)x0.0, shifted -0.2
+...\pdfsave
+...\pdfliteral{0.39851 w}
+...\pdfcolorstack 0 push {0 g 0 G}
+...\pdfliteral{0 J}
+...\pdfliteral{0 j}
+...\pdfliteral{10 M}
+...\pdfliteral{[] 0 d}
+...\hbox(0.0+0.0)x0.0
+....\pdfliteral{0 0 m}
+....\pdfliteral{283.46457 0 l}
+....\pdfliteral{141.73228 0 m}
+....\pdfliteral{141.73228 141.73228 l}
+....\pdfliteral{S}
+....\pdfcolorstack 0 push {1.0 0.0 0.0 rg 1.0 0.0 0.0 RG}
+....\pdfsave
+....\pdfcolorstack 0 push {0.0 0.0 1.0 rg 0.0 0.0 1.0 RG}
+....\hbox(0.0+0.0)x0.0
+.....\kern 0.0
+.....\hbox(6.94444+0.0)x0.0
+......\pdfsave
+......\pdfsetmatrix{1 0 0 1}
+......\hbox(6.94444+0.0)x0.0, glue set - 22.50005fil
+.......\hbox(6.94444+0.0)x22.50005
+........\OT1/cmr/m/n/10 H
+........\OT1/cmr/m/n/10 e
+........\OT1/cmr/m/n/10 l
+........\OT1/cmr/m/n/10 l
+........\OT1/cmr/m/n/10 o
+.......\glue 0.0 plus 1.0fil minus 1.0fil
+......\pdfrestore
+....\pdfcolorstack 0 pop
+....\pdfrestore
+....\pdfliteral{0 0 m}
+....\pdfliteral{141.73228 0 l}
+....\pdfliteral{70.86615 0 m}
+....\pdfliteral{70.86615 70.86615 l}
+....\pdfliteral{S}
+....\pdfcolorstack 0 pop
+...\pdfrestore
+...\pdfcolorstack 0 pop
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
 ============================================================
 ============================================================
 TEST 2: \draw_coffin_use:Nnn (n)
diff --git a/l3experimental/l3draw/testfiles/m3draw006.uptex.tlg b/l3experimental/l3draw/testfiles/m3draw006.uptex.tlg
index 07776cb90..7c3cfbb81 100644
--- a/l3experimental/l3draw/testfiles/m3draw006.uptex.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw006.uptex.tlg
@@ -310,6 +310,84 @@ l. ...  }
 ! OK.
 <argument> \l_tmpa_box 
 l. ...  }
+> \box...=
+\hbox(142.66377+0.0)x284.92755
+.\hbox(142.66377+0.0)x284.92755
+..\glue 0.2
+..\hbox(0.0+0.0)x0.0, shifted -0.2
+...\special{ps::[begin]}
+...\special{ps::/draw.x currentpoint /draw.y exch def def}
+...\special{ps::@beginspecial}
+...\special{ps::0.39851 setlinewidth}
+...\special{color push gray 0}
+...\special{ps:SDict begin /color.sc {} def end}
+...\special{ps::0 setlinecap}
+...\special{ps::0 setlinejoin}
+...\special{ps::10 setmiterlimit}
+...\special{ps::[] 0 setdash}
+...\hbox(0.0+0.0)x0.0
+....\special{ps::0 0 moveto}
+....\special{ps::283.46457 0 lineto}
+....\special{ps::141.73228 0 moveto}
+....\special{ps::141.73228 141.73228 lineto}
+....\special{ps::gsave}
+....\special{ps::color.sc}
+....\special{ps::stroke}
+....\special{ps::grestore}
+....\special{ps::newpath}
+....\special{color push rgb 1.0 0.0 0.0}
+....\special{ps:SDict begin /color.sc {} def end}
+....\special{ps::save}
+....\special{color push rgb 0.0 0.0 1.0}
+....\special{ps:SDict begin /color.sc {} def end}
+....\hbox(0.0+0.0)x0.0
+.....\kern 0.0
+.....\hbox(6.94444+0.0)x0.0
+......\special{ps::save}
+......\special{ps::72 Resolution div 72 VResolution div neg scale}
+......\special{ps::magscale{1 DVImag div dup scale}if}
+......\special{ps::draw.x neg draw.y neg translate}
+......\special{ps::[end]}
+......\special{ps::[begin]}
+......\special{ps::save}
+......\special{ps::currentpoint}
+......\special{ps::currentpoint translate}
+......\special{ps::[1 0 0 -1 0 0] concat}
+......\special{ps::[1 0 0 1 0 0] concat}
+......\special{ps::[1 0 0 -1 0 0] concat}
+......\special{ps::neg exch neg exch translate}
+......\special{ps::[end]}
+......\hbox(6.94444+0.0)x0.0, glue set - 22.50005fil
+.......\hbox(6.94444+0.0)x22.50005
+........\OT1/cmr/m/n/10 H
+........\OT1/cmr/m/n/10 e
+........\OT1/cmr/m/n/10 l
+........\OT1/cmr/m/n/10 l
+........\OT1/cmr/m/n/10 o
+.......\glue 0.0 plus 1.0fil minus 1.0fil
+......\special{ps::[begin]}
+......\special{ps::restore}
+......\special{ps::[end]}
+......\special{ps::[begin]}
+......\special{ps::restore}
+....\special{color pop}
+....\special{ps::restore}
+....\special{ps::0 0 moveto}
+....\special{ps::141.73228 0 lineto}
+....\special{ps::70.86615 0 moveto}
+....\special{ps::70.86615 70.86615 lineto}
+....\special{ps::gsave}
+....\special{ps::color.sc}
+....\special{ps::stroke}
+....\special{ps::grestore}
+....\special{ps::newpath}
+....\special{color pop}
+...\special{ps::@endspecial}
+...\special{ps::[end]}
+...\special{color pop}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
 ============================================================
 ============================================================
 TEST 2: \draw_coffin_use:Nnn (n)
diff --git a/l3experimental/l3draw/testfiles/m3draw006.xetex.tlg b/l3experimental/l3draw/testfiles/m3draw006.xetex.tlg
index e462df8ed..8e99a148b 100644
--- a/l3experimental/l3draw/testfiles/m3draw006.xetex.tlg
+++ b/l3experimental/l3draw/testfiles/m3draw006.xetex.tlg
@@ -195,6 +195,55 @@ l. ...  }
 ! OK.
 <argument> \l_tmpa_box 
 l. ...  }
+> \box...=
+\hbox(142.66377+0.0)x284.92755
+.\hbox(142.66377+0.0)x284.92755
+..\glue 0.2
+..\hbox(0.0+0.0)x0.0, shifted -0.2
+...\special{x:gsave}
+...\special{pdf:literal 0.39851 w}
+...\special{pdf:bc [0]}
+...\special{pdf:literal 0 J}
+...\special{pdf:literal 0 j}
+...\special{pdf:literal 10 M}
+...\special{pdf:literal [] 0 d}
+...\hbox(0.0+0.0)x0.0
+....\special{pdf:literal 0 0 m}
+....\special{pdf:literal 283.46457 0 l}
+....\special{pdf:literal 141.73228 0 m}
+....\special{pdf:literal 141.73228 141.73228 l}
+....\special{pdf:literal S}
+....\special{pdf:bc [1.0 0.0 0.0]}
+....\special{x:gsave}
+....\special{pdf:bc [0.0 0.0 1.0]}
+....\hbox(0.0+0.0)x0.0
+.....\kern 0.0
+.....\hbox(6.94444+0.0)x0.0
+......\special{x:gsave}
+......\special{pdf:btrans matrix 1 0 0 1 0 0}
+......\hbox(6.94444+0.0)x0.0, glue set - 22.50005fil
+.......\hbox(6.94444+0.0)x22.50005
+........\OT1/cmr/m/n/10 H
+........\OT1/cmr/m/n/10 e
+........\OT1/cmr/m/n/10 l
+........\OT1/cmr/m/n/10 l
+........\OT1/cmr/m/n/10 o
+.......\glue 0.0 plus 1.0fil minus 1.0fil
+......\special{pdf:etrans}
+......\special{x:grestore}
+....\special{pdf:ec}
+....\special{x:grestore}
+....\special{pdf:literal 0 0 m}
+....\special{pdf:literal 141.73228 0 l}
+....\special{pdf:literal 70.86615 0 m}
+....\special{pdf:literal 70.86615 70.86615 l}
+....\special{pdf:literal S}
+....\special{pdf:ec}
+...\special{x:grestore}
+...\special{pdf:ec}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
 ============================================================
 ============================================================
 TEST 2: \draw_coffin_use:Nnn (n)





More information about the latex3-commits mailing list.