diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def | 108 |
1 files changed, 99 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def index 80de21c81dd..4046489e12e 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def @@ -68,35 +68,125 @@ \hbox_overlap_right:n { \box_use:N #1 } \__driver_scope_end: } -\tl_new:N \l__driver_current_color_tl -\tl_set:Nn \l__driver_current_color_tl { [ 0 ] } +\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_current_color_tl { \current@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_current_color_tl } + \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 +\int_new:N \g__driver_image_int +\cs_new_protected:Npn \__driver_image_include_eps:n #1 + { + \tex_special:D { PSfile = #1 } + } +\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_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 + { :P \int_use:N \l__image_page_int } + \bool_if:NT \l__image_interpolate_bool + { :I } + } + {#1} {#2} + } +\cs_new_protected:Npn \__driver_image_include_auxii:nnn #1#2#3 + { + \int_if_exist:cTF { c__image_ #2#1 _int } + { + \tex_special:D + { pdf:usexobj~@image \int_use:c { c__image_ #2#1 _int } } + } + { \__driver_image_include_auxiii:nn {#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 + { + \int_gincr:N \g__driver_image_int + \int_const:cn { c__image_ #1#2 _int } { \g__driver_image_int } + \tex_special:D + { + pdf:#3~ + @image \int_use:c { c__image_ #1#2 _int } + \int_compare:nNnT \l__image_page_int > 0 + { page ~ \int_use:N \l__image_page_int \c_space_tl } + (#1) + \bool_if:NT \l__image_interpolate_bool + { <</Interpolate~true>> } + } + } \AtBeginDocument { \@ifpackageloaded { color } { - \cs_set_protected:Npn \__driver_color_ensure_current: + \cs_set_protected:Npn \__driver_tmp:w #1 [ #2 ] #3 \q_stop { - \tex_special:D { color~push~\l__driver_current_color_tl } - \group_insert_after:N \__driver_color_reset: + \tl_if_empty:nT {#2} + { + \cs_set_protected:Npn \__driver_color_ensure_current: + { + \tex_special:D { color~push~\l__driver_color_current_tl } + \group_insert_after:N \__driver_color_reset: + } + \cs_set_protected:Npn \__driver_color_reset: + { \tex_special:D { color~pop } } + } } - \cs_set_protected:Npn \__driver_color_reset: - { \tex_special:D { color~pop } } + \exp_after:wN \__driver_tmp:w \current@color [ ] \q_stop } { } } +\cs_new_protected:Npn \__driver_image_getbb_jpg:n #1 + { + \int_zero:N \l__image_page_int + \__driver_image_getbb_auxi:nN {#1} \xetex_picfile: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 + { \__driver_image_getbb_auxi:nN {#1} \xetex_pdffile:D } +\cs_new_protected:Npn \__driver_image_getbb_auxi:nN #1#2 + { + \int_compare:nNnTF \l__image_page_int > 0 + { \__driver_image_getbb_auxii:VnN \l__image_page_int {#1} #2 } + { \__driver_image_getbb_auxiii:nNnn {#1} #2 } + } +\cs_new_protected:Npn \__driver_image_getbb_auxii:nnN #1#2#3 + { \__driver_image_getbb_auxiii: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 + { + \dim_if_exist:cTF { c__image_ #1#3 _ht_dim } + { + \dim_set_eq:Nc \l__image_ht_dim { c__image_ #1#3 _ht_dim } + \dim_set_eq:Nc \l__image_wd_dim { c__image_ #1#3 _wd_dim } + } + { \__driver_image_getbb_auxvi:nNnn {#1} #2 {#3} {#4} } + } +\cs_new_protected:Npn \__driver_image_getbb_auxvi:nNnn #1#2#3#4 + { + \hbox_set:Nn \l__image_tmp_box { #2 #1 ~ #4 } + \dim_set:Nn \l__image_ht_dim { \box_ht:N \l__image_tmp_box } + \dim_set:Nn \l__image_wd_dim { \box_wd:N \l__image_tmp_box } + \dim_const:cn { c__image_ #1#3 _ht_dim } + { \l__image_ht_dim } + \dim_const:cn { c__image_ #1#3 _wd_dim } + { \l__image_wd_dim } + } \cs_new_eq:NN \__driver_draw_literal:n \__driver_literal:n \cs_generate_variant:Nn \__driver_draw_literal:n { x } \cs_new_protected:Npn \__driver_draw_begin: |