diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def | 67 |
1 files changed, 46 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def index 7d8c5b96f9e..60886d1f6c7 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def @@ -22,6 +22,22 @@ \ProvidesExplFile {l3dvidpfmx.def}{2017/03/18}{} {L3 Experimental driver: dvipdfmx} +\AtBeginDocument + { + \@ifpackageloaded { color } + { + \cs_new_protected:Npn \__driver_color_pickup: + { \tl_set_eq:NN \l__color_current_tl \current@color } + } + { \cs_new_protected:Npn \__driver_color_pickup: { } } + } +\cs_new_protected:Npn \__driver_color_ensure_current: + { + \__driver_color_pickup: + \tex_special:D { color~push~\l__color_current_tl } + } +\cs_new_protected:Npn \__driver_color_reset: + { \tex_special:D { color~pop } } \cs_new_protected:Npn \__driver_literal:n #1 { \tex_special:D { pdf:literal~ #1 } } \cs_new_protected:Npn \__driver_scope_begin: @@ -68,31 +84,18 @@ \hbox_overlap_right:n { \box_use:N #1 } \__driver_scope_end: } -\tl_new:N \l__driver_color_current_tl -\tl_set:Nn \l__driver_color_current_tl { [ 0 ] } -\AtBeginDocument - { - \@ifpackageloaded { color } - { \tl_set:Nn \l__driver_color_current_tl { \current@color } } - { } - } -\cs_new_protected:Npn \__driver_color_ensure_current: - { - \tex_special:D { pdf:bcolor~\l__driver_color_current_tl } - \group_insert_after:N \__driver_color_reset: - } -\cs_new_protected:Npn \__driver_color_reset: - { \tex_special:D { pdf:ecolor } } \cs_new_eq:NN \__driver_image_getbb_eps:n \__image_read_bb:n \cs_new_protected:Npn \__driver_image_getbb_jpg:n #1 { \int_zero:N \l__image_page_int + \tl_clear:N \l__image_pagebox_tl \__image_extract_bb:n {#1} } \cs_new_eq:NN \__driver_image_getbb_png:n \__driver_image_getbb_jpg:n \cs_new_protected:Npn \__driver_image_getbb_pdf:n #1 { - \bool_set_false:N \l__image_interpolate_tl + \tl_clear:N \l__image_decode_tl + \bool_set_false:N \l__image_interpolate_bool \__image_extract_bb:n {#1} } \int_new:N \g__driver_image_int @@ -102,15 +105,19 @@ } \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_png:n +\cs_new_eq:NN \__driver_image_include_png:n \__driver_image_include_jpg:n \cs_new_protected:Npn \__driver_image_include_pdf:n #1 { \__driver_image_include_auxi:nn {#1} { epdf } } \cs_new_protected:Npn \__driver_image_include_auxi:nn #1#2 { \__driver_image_include_auxii:xnn { - \int_compare:nNnT \l__image_page_int > 0 + \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_decode_tl } \bool_if:NT \l__image_interpolate_bool { :I } } @@ -134,11 +141,29 @@ { pdf:#3~ @image \int_use:c { c__image_ #1#2 _int } - \int_compare:nNnT \l__image_page_int > 0 + \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 + { + pagebox ~ \l__image_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 + } (#1) - \bool_if:NT \l__image_interpolate_bool - { <</Interpolate~true>> } + \bool_lazy_or:nnT + { \l__image_interpolate_bool } + { ! \tl_if_empty_p:N \l__imge_decode_tl } + { + << + \tl_if_empty:NF \l__imge_decode_tl + { /Decode~[ \l__imge_decode_tl ] } + \bool_if:NT \l__image_interpolate_bool + { /Interpolate~true> } + >> + } } } \cs_new_eq:NN \__driver_draw_literal:n \__driver_literal:n |