summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-05-09 21:21:40 +0000
committerKarl Berry <karl@freefriends.org>2019-05-09 21:21:40 +0000
commit6b8660f398522ec8c9225f4743bf35d7ead3fdbb (patch)
tree2d739ca19f398762c708fde206952877d04b1d9f /Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
parent85d267d6035b359acbbc8620e9f215658e2ef473 (diff)
l3kernel (9may19)
git-svn-id: svn://tug.org/texlive/trunk@51060 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def177
1 files changed, 94 insertions, 83 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
index 7fc986ec327..111087f7509 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
@@ -9,7 +9,7 @@
%% l3drivers-color.dtx (with options: `package,xdvipdfmx')
%% l3drivers-box.dtx (with options: `package,xdvipdfmx')
%% l3drivers-draw.dtx (with options: `package,xdvipdfmx')
-%% l3drivers-image.dtx (with options: `package,xdvipdfmx')
+%% l3drivers-graphics.dtx (with options: `package,xdvipdfmx')
%% l3drivers-pdf.dtx (with options: `package,xdvipdfmx')
%%
%% Copyright (C) 1990-2019 The LaTeX3 Project
@@ -33,6 +33,7 @@
\cs_new_protected:Npn \__driver_literal:n #1
{ \__driver_literal:e { \exp_not:n {#1} } }
\cs_generate_variant:Nn \__driver_literal:n { x }
+\box_new:N \l__driver_internal_box
\cs_new_protected:Npn \__driver_literal_pdf:n #1
{ \__driver_literal:n { pdf:literal~ #1 } }
\cs_generate_variant:Nn \__driver_literal_pdf:n { x }
@@ -351,134 +352,144 @@
\__driver_literal:n { pdf:etrans }
\__driver_scope_end:
}
-%% File: l3drivers-image.dtx
-\cs_new_eq:NN \__driver_image_getbb_eps:n \image_read_bb:n
-\int_new:N \g__driver_image_int
-\cs_new_protected:Npn \__driver_image_include_eps:n #1
+%% File: l3drivers-graphics.dtx
+\AtBeginDocument
+ { \cs_new_eq:NN \driver_graphics_getbb_eps:n \graphics_read_bb:n }
+\int_new:N \g__driver_graphics_int
+\cs_new_protected:Npn \driver_graphics_include_eps:n #1
{
- \__driver_literal:n { PSfile = #1 }
+ \__driver_literal:x
+ {
+ PSfile = #1 \c_space_tl
+ llx = \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl
+ lly = \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl
+ urx = \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl
+ ury = \dim_to_decimal_in_bp:n \l_graphics_ury_dim
+ }
}
-\cs_new_protected:Npn \__driver_image_include_jpg:n #1
- { \__driver_image_include_auxi:nn {#1} { image } }
-\cs_new_eq:NN \__driver_image_include_png:n \__driver_image_include_jpg:n
-\cs_new_protected:Npn \__driver_image_include_auxi:nn #1#2
+\cs_new_protected:Npn \driver_graphics_include_jpg:n #1
+ { \__driver_graphics_include_auxi:nn {#1} { image } }
+\cs_new_eq:NN \driver_graphics_include_png:n \driver_graphics_include_jpg:n
+\cs_new_protected:Npn \__driver_graphics_include_auxi:nn #1#2
{
- \__driver_image_include_auxii:xnn
+ \__driver_graphics_include_auxii:xnn
{
- \tl_if_empty:NF \l_image_pagebox_tl
- { : \l_image_pagebox_tl }
- \int_compare:nNnT \l_image_page_int > 1
- { :P \int_use:N \l_image_page_int }
- \tl_if_empty:NF \l_image_decode_tl
- { :D \l_image_decodearray_tl }
- \bool_if:NT \l_image_interpolate_bool
+ \tl_if_empty:NF \l_graphics_pagebox_tl
+ { : \l_graphics_pagebox_tl }
+ \int_compare:nNnT \l_graphics_page_int > 1
+ { :P \int_use:N \l_graphics_page_int }
+ \tl_if_empty:NF \l_graphics_decodearray_tl
+ { :D \l_graphics_decodearray_tl }
+ \bool_if:NT \l_graphics_interpolate_bool
{ :I }
}
{#1} {#2}
}
-\cs_new_protected:Npn \__driver_image_include_auxii:nnn #1#2#3
+\cs_new_protected:Npn \__driver_graphics_include_auxii:nnn #1#2#3
{
- \int_if_exist:cTF { c__driver_image_ #2#1 _int }
+ \int_if_exist:cTF { c__driver_graphics_ #2#1 _int }
{
\__driver_literal:x
- { pdf:usexobj~@image \int_use:c { c__driver_image_ #2#1 _int } }
+ { pdf:usexobj~@image \int_use:c { c__driver_graphics_ #2#1 _int } }
}
- { \__driver_image_include_auxiii:nn {#2} {#1} {#3} }
+ { \__driver_graphics_include_auxiii:nnn {#2} {#1} {#3} }
}
-\cs_generate_variant:Nn \__driver_image_include_auxii:nnn { x }
-\cs_new_protected:Npn \__driver_image_include_auxiii:nnn #1#2#3
+\cs_generate_variant:Nn \__driver_graphics_include_auxii:nnn { x }
+\cs_new_protected:Npn \__driver_graphics_include_auxiii:nnn #1#2#3
{
- \int_gincr:N \g__driver_image_int
- \int_const:cn { c__driver_image_ #1#2 _int } { \g__driver_image_int }
+ \int_gincr:N \g__driver_graphics_int
+ \int_const:cn { c__driver_graphics_ #1#2 _int } { \g__driver_graphics_int }
\__driver_literal:x
{
pdf:#3~
- @image \int_use:c { c__driver_image_ #1#2 _int }
- \int_compare:nNnT \l_image_page_int > 1
- { page ~ \int_use:N \l_image_page_int \c_space_tl }
- \tl_if_empty:NF \l_image_pagebox_tl
+ @image \int_use:c { c__driver_graphics_ #1#2 _int } ~
+ \int_compare:nNnT \l_graphics_page_int > 1
+ { page ~ \int_use:N \l_graphics_page_int \c_space_tl }
+ \tl_if_empty:NF \l_graphics_pagebox_tl
{
- pagebox ~ \l_image_pagebox_tl \c_space_tl
+ pagebox ~ \l_graphics_pagebox_tl \c_space_tl
bbox ~
- \dim_to_decimal_in_bp:n \l_image_llx_dim \c_space_tl
- \dim_to_decimal_in_bp:n \l_image_lly_dim \c_space_tl
- \dim_to_decimal_in_bp:n \l_image_urx_dim \c_space_tl
- \dim_to_decimal_in_bp:n \l_image_ury_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l_graphics_ury_dim \c_space_tl
}
(#1)
\bool_lazy_or:nnT
- { \l_image_interpolate_bool }
- { ! \tl_if_empty_p:N \l_image_decodearray_tl }
+ { \l_graphics_interpolate_bool }
+ { ! \tl_if_empty_p:N \l_graphics_decodearray_tl }
{
<<
- \tl_if_empty:NF \l_image_decode_tl
- { /Decode~[ \l_image_decodearray_tl ] }
- \bool_if:NT \l_image_interpolate_bool
+ \tl_if_empty:NF \l_graphics_decodearray_tl
+ { /Decode~[ \l_graphics_decodearray_tl ] }
+ \bool_if:NT \l_graphics_interpolate_bool
{ /Interpolate~true> }
>>
}
}
}
-\cs_new_protected:Npn \__driver_image_getbb_jpg:n #1
+\cs_new_protected:Npn \driver_graphics_getbb_jpg:n #1
{
- \int_zero:N \l_image_page_int
- \tl_clear:N \l_image_pagebox_tl
- \__driver_image_getbb_auxi:nN {#1} \tex_XeTeXpicfile:D
+ \int_zero:N \l_graphics_page_int
+ \tl_clear:N \l_graphics_pagebox_tl
+ \__driver_graphics_getbb_auxi:nN {#1} \tex_XeTeXpicfile:D
}
-\cs_new_eq:NN \__driver_image_getbb_png:n \__driver_image_getbb_jpg:n
-\cs_new_protected:Npn \__driver_image_getbb_pdf:n #1
+\cs_new_eq:NN \driver_graphics_getbb_png:n \driver_graphics_getbb_jpg:n
+\cs_new_protected:Npn \driver_graphics_getbb_pdf:n #1
{
- \tl_clear:N \l_image_decode_tl
- \bool_set_false:N \l_image_interpolate_bool
- \__driver_image_getbb_auxi:nN {#1} \tex_XeTeXpdffile:D
+ \tl_clear:N \l_graphics_decodearray_tl
+ \bool_set_false:N \l_graphics_interpolate_bool
+ \__driver_graphics_getbb_auxi:nN {#1} \tex_XeTeXpdffile:D
}
-\cs_new_protected:Npn \__driver_image_getbb_auxi:nN #1#2
+\cs_new_protected:Npn \__driver_graphics_getbb_auxi:nN #1#2
{
- \int_compare:nNnTF \l_image_page_int > 1
- { \__driver_image_getbb_auxii:VnN \l_image_page_int {#1} #2 }
- { \__driver_image_getbb_auxiii:nNnn {#1} #2 }
+ \int_compare:nNnTF \l_graphics_page_int > 1
+ { \__driver_graphics_getbb_auxii:VnN \l_graphics_page_int {#1} #2 }
+ { \__driver_graphics_getbb_auxiii:nNnn {#1} #2 { :P 1 } { page 1 } }
}
-\cs_new_protected:Npn \__driver_image_getbb_auxii:nnN #1#2#3
- { \__driver_image_getbb_aux:nNnn {#2} #3 { :P #1 } { page #1 } }
-\cs_generate_variant:Nn \__driver_image_getbb_auxii:nnN { V }
-\cs_new_protected:Npn \__driver_image_getbb_auxiii:nNnn #1#2#3#4
+\cs_new_protected:Npn \__driver_graphics_getbb_auxii:nnN #1#2#3
+ { \__driver_graphics_getbb_auxiii:nNnn {#2} #3 { :P #1 } { page #1 } }
+\cs_generate_variant:Nn \__driver_graphics_getbb_auxii:nnN { V }
+\cs_new_protected:Npn \__driver_graphics_getbb_auxiii:nNnn #1#2#3#4
{
- \tl_if_empty:NTF \l_image_pagebox_tl
- { \__driver_image_getbb_auxiv:VnNnn \l_image_pagebox_tl }
- { \__driver_image_getbb_auxv:nNnn }
+ \tl_if_empty:NTF \l_graphics_pagebox_tl
+ { \__driver_graphics_getbb_auxiv:VnNnn \l_graphics_pagebox_tl }
+ { \__driver_graphics_getbb_auxv:nNnn }
{#1} #2 {#3} {#4}
}
-\cs_new_protected:Npn \__driver_image_getbb_auxiv:nnNnn #1#2#3#4#5
+\cs_new_protected:Npn \__driver_graphics_getbb_auxiv:nnNnn #1#2#3#4#5
{
\use:x
{
- \__driver_image_getbb_auxv:nNnn {#2} #3 { : #1 #4 }
- { #5 ~ \__driver_image_getbb_pagebox:w #1 }
+ \__driver_graphics_getbb_auxv:nNnn {#2} #3 { : #1 #4 }
+ { #5 ~ \__driver_graphics_getbb_pagebox:w #1 }
}
}
-\cs_generate_variant:Nn \__driver_image_getbb_auxiv:nnNnn { V }
-\cs_new_protected:Npn \__driver_image_getbb_auxv:nNnn #1#2#3#4
+\cs_generate_variant:Nn \__driver_graphics_getbb_auxiv:nnNnn { V }
+\cs_new_protected:Npn \__driver_graphics_getbb_auxv:nNnn #1#2#3#4
{
- \image_bb_restore:nF {#1#3}
- { \__driver_image_getbb_auxvi:nNnn {#1} #2 {#3} {#4} }
+ \graphics_bb_restore:nF {#1#3}
+ { \__driver_graphics_getbb_auxvi:nNnn {#1} #2 {#3} {#4} }
}
-\cs_new_protected:Npn \__driver_image_getbb_auxvi:nNnn #1#2#3#4
+\cs_new_protected:Npn \__driver_graphics_getbb_auxvi:nNnn #1#2#3#4
{
- \hbox_set:Nn \l__driver_tmp_box { #2 #1 ~ #4 }
- \dim_set:Nn \l_image_utx_dim { \box_wd:N \l__driver_tmp_box }
- \dim_set:Nn \l_image_ury_dim { \box_ht:N \l__driver_tmp_box }
- \image_bb_save:n {#1#3}
+ \hbox_set:Nn \l__driver_internal_box { #2 #1 ~ #4 }
+ \dim_set:Nn \l_graphics_urx_dim { \box_wd:N \l__driver_internal_box }
+ \dim_set:Nn \l_graphics_ury_dim { \box_ht:N \l__driver_internal_box }
+ \graphics_bb_save:n {#1#3}
}
-\cs_new:Npn \__driver_image_getbb_pagebox:w #1 box {#1}
-\cs_new_protected:Npn \__driver_image_include_pdf:n #1
+\cs_new:Npn \__driver_graphics_getbb_pagebox:w #1 box {#1}
+\cs_new_protected:Npn \driver_graphics_include_pdf:n #1
{
- \tex_XeTeXpdffile:D "#1" ~
- \int_compare:nNnT \l_image_page_int > 0
- { page~ \int_use:N \l_image_page_int }
- \__driver_image_getbb_auxiv:VnNnn \l_image_pagebox_tl
+ \tex_XeTeXpdffile:D
+ \__driver_graphics_include_pdf_quote:w #1 "#1" \q_stop \c_space_tl
+ \int_compare:nNnT \l_graphics_page_int > 0
+ { page ~ \int_use:N \l_graphics_page_int \c_space_tl }
+ \exp_after:wN \__driver_graphics_getbb_pagebox:w \l_graphics_pagebox_tl
}
+\cs_new:Npn \__driver_graphics_include_pdf_quote:w #1 " #2 " #3 \q_stop
+ { " #2 " }
%% File: l3drivers-pdf.dtx
-\box_new:N \l__driver_pdf_tmp_box
\cs_new_protected:Npx \__driver_pdf:n #1
{ \__driver_literal:n { pdf: #1 } }
\cs_generate_variant:Nn \__driver_pdf:n { x }
@@ -618,8 +629,8 @@
\cs_new_protected:Npn \driver_pdf_destination_rectangle:nn #1#2
{
\group_begin:
- \hbox_set:Nn \l__driver_pdf_tmp_box {#2}
- \box_move_down:nn { \box_dp:N \l__driver_pdf_tmp_box }
+ \hbox_set:Nn \l__driver_internal_box {#2}
+ \box_move_down:nn { \box_dp:N \l__driver_internal_box }
{
\hbox:n
{
@@ -627,8 +638,8 @@
\__driver_pdf:n { obj ~ @driver_#1_lly ~ @ypos }
}
}
- \box_use:N \l__driver_pdf_tmp_box
- \box_move_up:nn { \box_ht:N \l__driver_pdf_tmp_box }
+ \box_use:N \l__driver_internal_box
+ \box_move_up:nn { \box_ht:N \l__driver_internal_box }
{
\hbox:n
{