[latex3-commits] [git/LaTeX3-latex3-latex3] master: Use a common driver box in pdfmode (b6fedb2)
Joseph Wright
joseph.wright at morningstar2.co.uk
Tue May 7 22:54:19 CEST 2019
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/b6fedb2bc1750cf86be0aefff2e2a5c2750ff078
>---------------------------------------------------------------
commit b6fedb2bc1750cf86be0aefff2e2a5c2750ff078
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Tue May 7 21:54:03 2019 +0100
Use a common driver box in pdfmode
Internal box
Mumble
>---------------------------------------------------------------
b6fedb2bc1750cf86be0aefff2e2a5c2750ff078
l3kernel/l3drivers-basics.dtx | 7 +++++++
l3kernel/l3drivers-image.dtx | 12 +++++------
l3kernel/l3drivers-pdf.dtx | 33 ++++++++++++------------------
l3kernel/testfiles/m3expl001.luatex.tlg | 4 ++--
l3kernel/testfiles/m3expl001.ptex.tlg | 4 ++--
l3kernel/testfiles/m3expl001.tlg | 4 ++--
l3kernel/testfiles/m3expl001.uptex.tlg | 4 ++--
l3kernel/testfiles/m3expl001.xetex.tlg | 4 ++--
l3kernel/testfiles/m3expl003.luatex.tlg | 4 ++--
l3kernel/testfiles/m3expl003.ptex.tlg | 4 ++--
l3kernel/testfiles/m3expl003.tlg | 4 ++--
l3kernel/testfiles/m3expl003.uptex.tlg | 4 ++--
l3kernel/testfiles/m3expl003.xetex.tlg | 4 ++--
l3trial/l3image/testfiles/m3image000.tlg | 1 +
14 files changed, 47 insertions(+), 46 deletions(-)
diff --git a/l3kernel/l3drivers-basics.dtx b/l3kernel/l3drivers-basics.dtx
index 9b96744..4fd5e83 100644
--- a/l3kernel/l3drivers-basics.dtx
+++ b/l3kernel/l3drivers-basics.dtx
@@ -117,6 +117,13 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{variable}{\l_@@_internal_box}
+% A scratch box.
+% \begin{macrocode}
+\box_new:N \l_@@_internal_box
+% \end{macrocode}
+% \end{variable}
+%
% \subsection{\texttt{dvips} driver}
%
% \begin{macrocode}
diff --git a/l3kernel/l3drivers-image.dtx b/l3kernel/l3drivers-image.dtx
index 0324e0d..ca6469e 100644
--- a/l3kernel/l3drivers-image.dtx
+++ b/l3kernel/l3drivers-image.dtx
@@ -182,10 +182,10 @@
\tl_if_empty:NF \l_image_pagebox_tl
{ \l_image_pagebox_tl }
{#1}
- \hbox_set:Nn \l_@@_tmp_box
+ \hbox_set:Nn \l_@@_internal_box
{ \tex_pdfrefximage:D \tex_pdflastximage:D }
- \dim_set:Nn \l_image_urx_dim { \box_wd:N \l_@@_tmp_box }
- \dim_set:Nn \l_image_ury_dim { \box_ht:N \l_@@_tmp_box }
+ \dim_set:Nn \l_image_urx_dim { \box_wd:N \l_@@_internal_box }
+ \dim_set:Nn \l_image_ury_dim { \box_ht:N \l_@@_internal_box }
\int_const:cn { c_@@_image_ #1 \l_@@_image_attr_tl _int }
{ \tex_the:D \tex_pdflastximage:D }
\image_bb_save:x { #1 \l_@@_image_attr_tl }
@@ -432,9 +432,9 @@
}
\cs_new_protected:Npn \@@_image_getbb_auxvi:nNnn #1#2#3#4
{
- \hbox_set:Nn \l_@@_tmp_box { #2 #1 ~ #4 }
- \dim_set:Nn \l_image_utx_dim { \box_wd:N \l_@@_tmp_box }
- \dim_set:Nn \l_image_ury_dim { \box_ht:N \l_@@_tmp_box }
+ \hbox_set:Nn \l_@@_internal_box { #2 #1 ~ #4 }
+ \dim_set:Nn \l_image_utx_dim { \box_wd:N \l_@@_internal_box }
+ \dim_set:Nn \l_image_ury_dim { \box_ht:N \l_@@_internal_box }
\image_bb_save:n {#1#3}
}
\cs_new:Npn \@@_image_getbb_pagebox:w #1 box {#1}
diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index 66fa575..26d5e34 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -71,13 +71,6 @@
% A very small number of items that belong at the driver level but which
% are common to all drivers.
%
-% \begin{variable}{\l_@@_pdf_tmp_box}
-% For fitting destinations.
-% \begin{macrocode}
-\box_new:N \l_@@_pdf_tmp_box
-% \end{macrocode}
-% \end{variable}
-%
% \subsection{\texttt{dvips} driver}
%
% \begin{macrocode}
@@ -1159,13 +1152,13 @@
\cs_new_protected:Npn \driver_pdf_destination_rectangle:nn #1#2
{
\group_begin:
- \hbox_set:Nn \l_@@_pdf_tmp_box {#2}
+ \hbox_set:Nn \l_@@_internal_box {#2}
\box_move_down:nn
- { \box_dp:N \l_@@_pdf_tmp_box }
+ { \box_dp:N \l_@@_internal_box }
{ \hbox:n { \@@_postscript:n { driver.save.ll } } }
- \box_use:N \l_@@_pdf_tmp_box
+ \box_use:N \l_@@_internal_box
\box_move_up:nn
- { \box_ht:N \l_@@_pdf_tmp_box }
+ { \box_ht:N \l_@@_internal_box }
{ \hbox:n { \@@_postscript:n { driver.save.ur } } }
\@@_pdfmark:n
{
@@ -1338,16 +1331,16 @@
\cs_new_protected:Npx \driver_pdf_destination_rectangle:nn #1#2
{
\group_begin:
- \hbox_set:Nn \l_@@_pdf_tmp_box {#2}
+ \hbox_set:Nn \l_@@_internal_box {#2}
\cs_if_exist:NTF \tex_pdfextension:D
{ \exp_not:N \tex_pdfextension:D dest ~ }
{ \exp_not:N \tex_pdfdest:D }
name {#1}
fitr ~
- width \exp_not:N \box_wd:N \l_@@_pdf_tmp_box
- height \exp_not:N \box_ht:N \l_@@_pdf_tmp_box
- depth \exp_not:N \box_dp:N \l_@@_pdf_tmp_box
- \box_use:N \l_@@_pdf_tmp_box
+ width \exp_not:N \box_wd:N \l_@@_internal_box
+ height \exp_not:N \box_ht:N \l_@@_internal_box
+ depth \exp_not:N \box_dp:N \l_@@_internal_box
+ \box_use:N \l_@@_internal_box
\group_end:
}
% \end{macrocode}
@@ -1797,8 +1790,8 @@
\cs_new_protected:Npn \driver_pdf_destination_rectangle:nn #1#2
{
\group_begin:
- \hbox_set:Nn \l_@@_pdf_tmp_box {#2}
- \box_move_down:nn { \box_dp:N \l_@@_pdf_tmp_box }
+ \hbox_set:Nn \l_@@_internal_box {#2}
+ \box_move_down:nn { \box_dp:N \l_@@_internal_box }
{
\hbox:n
{
@@ -1806,8 +1799,8 @@
\@@_pdf:n { obj ~ @driver_#1_lly ~ @ypos }
}
}
- \box_use:N \l_@@_pdf_tmp_box
- \box_move_up:nn { \box_ht:N \l_@@_pdf_tmp_box }
+ \box_use:N \l_@@_internal_box
+ \box_move_up:nn { \box_ht:N \l_@@_internal_box }
{
\hbox:n
{
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index 2ee1f3f..b373ee5 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -6409,6 +6409,8 @@ File: l3pdfmode.def ....-..-.. v L3 Experimental driver: PDF mode
Defining \__driver_literal:e on line ...
Defining \__driver_literal:n on line ...
Defining \__driver_literal:x on line ...
+Defining \l__driver_internal_box on line ...
+\l__driver_internal_box=\box...
Defining \__driver_literal_pdf:n on line ...
Defining \__driver_literal_pdf:x on line ...
Defining \__driver_scope_begin: on line ...
@@ -6483,8 +6485,6 @@ Defining \__driver_image_getbb_auxii:n on line ...
Defining \__driver_image_include_jpg:n on line ...
Defining \__driver_image_include_pdf:n on line ...
Defining \__driver_image_include_png:n on line ...
-Defining \l__driver_pdf_tmp_box on line ...
-\l__driver_pdf_tmp_box=\box...
Defining \driver_pdf_annotation:nnnn on line ...
Defining \driver_pdf_annotation_last: on line ...
Defining \driver_pdf_link_begin_goto:nnw on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 570a80e..6946213 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -6407,6 +6407,8 @@ File: l3dvipdfmx.def ....-..-.. v L3 Experimental driver: dvipdfmx
Defining \__driver_literal:e on line ...
Defining \__driver_literal:n on line ...
Defining \__driver_literal:x on line ...
+Defining \l__driver_internal_box on line ...
+\l__driver_internal_box=\box...
Defining \__driver_literal_pdf:n on line ...
Defining \__driver_literal_pdf:x on line ...
Defining \__driver_scope_begin: on line ...
@@ -6482,8 +6484,6 @@ Defining \__driver_image_include_auxi:nn on line ...
Defining \__driver_image_include_auxii:nnn on line ...
Defining \__driver_image_include_auxii:xnn on line ...
Defining \__driver_image_include_auxiii:nnn on line ...
-Defining \l__driver_pdf_tmp_box on line ...
-\l__driver_pdf_tmp_box=\box...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
Defining \driver_pdf_catalog_gput:nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 4f5704a..7bcd62e 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -6707,6 +6707,8 @@ File: l3pdfmode.def ....-..-.. v L3 Experimental driver: PDF mode
Defining \__driver_literal:e on line ...
Defining \__driver_literal:n on line ...
Defining \__driver_literal:x on line ...
+Defining \l__driver_internal_box on line ...
+\l__driver_internal_box=\box...
Defining \__driver_literal_pdf:n on line ...
Defining \__driver_literal_pdf:x on line ...
Defining \__driver_scope_begin: on line ...
@@ -6781,8 +6783,6 @@ Defining \__driver_image_getbb_auxii:n on line ...
Defining \__driver_image_include_jpg:n on line ...
Defining \__driver_image_include_pdf:n on line ...
Defining \__driver_image_include_png:n on line ...
-Defining \l__driver_pdf_tmp_box on line ...
-\l__driver_pdf_tmp_box=\box...
Defining \driver_pdf_annotation:nnnn on line ...
Defining \driver_pdf_annotation_last: on line ...
Defining \driver_pdf_link_begin_goto:nnw on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 0519a59..6688782 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -6704,6 +6704,8 @@ File: l3dvipdfmx.def ....-..-.. v L3 Experimental driver: dvipdfmx
Defining \__driver_literal:e on line ...
Defining \__driver_literal:n on line ...
Defining \__driver_literal:x on line ...
+Defining \l__driver_internal_box on line ...
+\l__driver_internal_box=\box...
Defining \__driver_literal_pdf:n on line ...
Defining \__driver_literal_pdf:x on line ...
Defining \__driver_scope_begin: on line ...
@@ -6779,8 +6781,6 @@ Defining \__driver_image_include_auxi:nn on line ...
Defining \__driver_image_include_auxii:nnn on line ...
Defining \__driver_image_include_auxii:xnn on line ...
Defining \__driver_image_include_auxiii:nnn on line ...
-Defining \l__driver_pdf_tmp_box on line ...
-\l__driver_pdf_tmp_box=\box...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
Defining \driver_pdf_catalog_gput:nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index 44d1721..b3f64bd 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -6408,6 +6408,8 @@ File: l3xdvipdfmx.def ....-..-.. v L3 Experimental driver: xdvipdfmx
Defining \__driver_literal:e on line ...
Defining \__driver_literal:n on line ...
Defining \__driver_literal:x on line ...
+Defining \l__driver_internal_box on line ...
+\l__driver_internal_box=\box...
Defining \__driver_literal_pdf:n on line ...
Defining \__driver_literal_pdf:x on line ...
Defining \__driver_scope_begin: on line ...
@@ -6492,8 +6494,6 @@ Defining \__driver_image_getbb_auxv:nNnn on line ...
Defining \__driver_image_getbb_auxvi:nNnn on line ...
Defining \__driver_image_getbb_pagebox:w on line ...
Defining \__driver_image_include_pdf:n on line ...
-Defining \l__driver_pdf_tmp_box on line ...
-\l__driver_pdf_tmp_box=\box...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
Defining \driver_pdf_catalog_gput:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index 2ee1f3f..b373ee5 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -6409,6 +6409,8 @@ File: l3pdfmode.def ....-..-.. v L3 Experimental driver: PDF mode
Defining \__driver_literal:e on line ...
Defining \__driver_literal:n on line ...
Defining \__driver_literal:x on line ...
+Defining \l__driver_internal_box on line ...
+\l__driver_internal_box=\box...
Defining \__driver_literal_pdf:n on line ...
Defining \__driver_literal_pdf:x on line ...
Defining \__driver_scope_begin: on line ...
@@ -6483,8 +6485,6 @@ Defining \__driver_image_getbb_auxii:n on line ...
Defining \__driver_image_include_jpg:n on line ...
Defining \__driver_image_include_pdf:n on line ...
Defining \__driver_image_include_png:n on line ...
-Defining \l__driver_pdf_tmp_box on line ...
-\l__driver_pdf_tmp_box=\box...
Defining \driver_pdf_annotation:nnnn on line ...
Defining \driver_pdf_annotation_last: on line ...
Defining \driver_pdf_link_begin_goto:nnw on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 570a80e..6946213 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -6407,6 +6407,8 @@ File: l3dvipdfmx.def ....-..-.. v L3 Experimental driver: dvipdfmx
Defining \__driver_literal:e on line ...
Defining \__driver_literal:n on line ...
Defining \__driver_literal:x on line ...
+Defining \l__driver_internal_box on line ...
+\l__driver_internal_box=\box...
Defining \__driver_literal_pdf:n on line ...
Defining \__driver_literal_pdf:x on line ...
Defining \__driver_scope_begin: on line ...
@@ -6482,8 +6484,6 @@ Defining \__driver_image_include_auxi:nn on line ...
Defining \__driver_image_include_auxii:nnn on line ...
Defining \__driver_image_include_auxii:xnn on line ...
Defining \__driver_image_include_auxiii:nnn on line ...
-Defining \l__driver_pdf_tmp_box on line ...
-\l__driver_pdf_tmp_box=\box...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
Defining \driver_pdf_catalog_gput:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 4f5704a..7bcd62e 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -6707,6 +6707,8 @@ File: l3pdfmode.def ....-..-.. v L3 Experimental driver: PDF mode
Defining \__driver_literal:e on line ...
Defining \__driver_literal:n on line ...
Defining \__driver_literal:x on line ...
+Defining \l__driver_internal_box on line ...
+\l__driver_internal_box=\box...
Defining \__driver_literal_pdf:n on line ...
Defining \__driver_literal_pdf:x on line ...
Defining \__driver_scope_begin: on line ...
@@ -6781,8 +6783,6 @@ Defining \__driver_image_getbb_auxii:n on line ...
Defining \__driver_image_include_jpg:n on line ...
Defining \__driver_image_include_pdf:n on line ...
Defining \__driver_image_include_png:n on line ...
-Defining \l__driver_pdf_tmp_box on line ...
-\l__driver_pdf_tmp_box=\box...
Defining \driver_pdf_annotation:nnnn on line ...
Defining \driver_pdf_annotation_last: on line ...
Defining \driver_pdf_link_begin_goto:nnw on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 0519a59..6688782 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -6704,6 +6704,8 @@ File: l3dvipdfmx.def ....-..-.. v L3 Experimental driver: dvipdfmx
Defining \__driver_literal:e on line ...
Defining \__driver_literal:n on line ...
Defining \__driver_literal:x on line ...
+Defining \l__driver_internal_box on line ...
+\l__driver_internal_box=\box...
Defining \__driver_literal_pdf:n on line ...
Defining \__driver_literal_pdf:x on line ...
Defining \__driver_scope_begin: on line ...
@@ -6779,8 +6781,6 @@ Defining \__driver_image_include_auxi:nn on line ...
Defining \__driver_image_include_auxii:nnn on line ...
Defining \__driver_image_include_auxii:xnn on line ...
Defining \__driver_image_include_auxiii:nnn on line ...
-Defining \l__driver_pdf_tmp_box on line ...
-\l__driver_pdf_tmp_box=\box...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
Defining \driver_pdf_catalog_gput:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index 44d1721..b3f64bd 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -6408,6 +6408,8 @@ File: l3xdvipdfmx.def ....-..-.. v L3 Experimental driver: xdvipdfmx
Defining \__driver_literal:e on line ...
Defining \__driver_literal:n on line ...
Defining \__driver_literal:x on line ...
+Defining \l__driver_internal_box on line ...
+\l__driver_internal_box=\box...
Defining \__driver_literal_pdf:n on line ...
Defining \__driver_literal_pdf:x on line ...
Defining \__driver_scope_begin: on line ...
@@ -6492,8 +6494,6 @@ Defining \__driver_image_getbb_auxv:nNnn on line ...
Defining \__driver_image_getbb_auxvi:nNnn on line ...
Defining \__driver_image_getbb_pagebox:w on line ...
Defining \__driver_image_include_pdf:n on line ...
-Defining \l__driver_pdf_tmp_box on line ...
-\l__driver_pdf_tmp_box=\box...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
Defining \driver_pdf_catalog_gput:nn on line ...
diff --git a/l3trial/l3image/testfiles/m3image000.tlg b/l3trial/l3image/testfiles/m3image000.tlg
index 1f39a5f..74c6efe 100644
--- a/l3trial/l3image/testfiles/m3image000.tlg
+++ b/l3trial/l3image/testfiles/m3image000.tlg
@@ -8,4 +8,5 @@ Package: l3image ....-..-.. L3 Experimental image inclusion support
\l_image_lly_dim=\dimen...
\l_image_urx_dim=\dimen...
\l_image_ury_dim=\dimen...
+\l__image_internal_box=\box...
)
More information about the latex3-commits
mailing list