diff options
author | Karl Berry <karl@freefriends.org> | 2018-04-30 22:39:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-04-30 22:39:09 +0000 |
commit | a28e1bfccd6fe522fcd296426e4d89c7fb4f19b6 (patch) | |
tree | b72347e08575b56fcfed87c4d837b48dcfd1e02a /Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def | |
parent | b40c37a9e22b8235ff9c0bc256d00f7af94304c3 (diff) |
l3 (30apr18)
git-svn-id: svn://tug.org/texlive/trunk@47516 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.def | 123 |
1 files changed, 85 insertions, 38 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def index d72da1a8865..73cdee51f42 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def @@ -20,8 +20,12 @@ %% %% File: l3drivers.dtx Copyright(C) 2011-2018 The LaTeX3 Project \ProvidesExplFile - {l3xdvidpfmx.def}{2017/03/18}{} + {l3xdvidpfmx.def}{2018-04-30}{} {L3 Experimental driver: xdvipdfmx} +\cs_new_eq:NN \__driver_literal_x:n \tex_special:D +\cs_new_protected:Npn \__driver_literal:n #1 + { \__driver_literal_x:n { \exp_not:n {#1} } } +\cs_generate_variant:Nn \__driver_literal:n { x } \cs_new_protected:Npn \driver_color_pickup:N #1 { } \AtBeginDocument { @@ -37,7 +41,10 @@ \exp_after:wN \use:n \current@color \c_space_tl 1 } } - { \exp_after:wN \__driver_color_pickup:w \current@color \q_stop #1 } + { + \exp_after:wN \__driver_color_pickup:w + \current@color \q_stop #1 + } } \cs_new_protected:Npn \__driver_color_pickup:w #1 ~ #2 \q_stop #3 { \tl_set:Nn #3 { #1 ~ #2 } } @@ -45,30 +52,42 @@ { } } \cs_new_protected:Npn \driver_color_cmyk:nnnn #1#2#3#4 - { \__driver_color_select:n { cmyk~ #1 ~ #2 ~ #3 ~ #4 } } + { + \__driver_color_select:x + { + cmyk~ + \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ + \fp_eval:n {#3} ~ \fp_eval:n {#4} + } + } \cs_new_protected:Npn \driver_color_gray:n #1 - { \__driver_color_select:n { gray~ #1 } } + { \__driver_color_select:x { gray~ \fp_eval:n {#1} } } \cs_new_protected:Npn \driver_color_rgb:nnn #1#2#3 - { \__driver_color_select:n { rgb~ #1 ~ #2 ~ #3 } } + { + \__driver_color_select:x + { rgb~ \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} } + } \cs_new_protected:Npn \driver_color_spot:nn #1#2 { \__driver_color_select:n { \c_space_tl #1 } } \cs_new_protected:Npn \__driver_color_select:n #1 { - \tex_special:D { color~push~ #1 } + \__driver_literal:n { color~push~ #1 } \group_insert_after:N \__driver_color_reset: } +\cs_generate_variant:Nn \__driver_color_select:n { x } \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 } } + { \__driver_literal:n { color~pop } } +\cs_new_protected:Npn \__driver_literal_pdf:n #1 + { \__driver_literal:n { pdf:literal~ #1 } } +\cs_generate_variant:Nn \__driver_literal_pdf:n { x } \cs_new_protected:Npn \__driver_scope_begin: - { \tex_special:D { x:gsave } } + { \__driver_literal:n { x:gsave } } \cs_new_protected:Npn \__driver_scope_end: - { \tex_special:D { x:grestore } } + { \__driver_literal:n { x:grestore } } \cs_new_protected:Npn \driver_box_use_clip:N #1 { \__driver_scope_begin: - \__driver_literal:n + \__driver_literal_pdf:x { 0~ \dim_to_decimal_in_bp:n { -\box_dp:N #1 } ~ @@ -81,9 +100,11 @@ \skip_horizontal:n { \box_wd:N #1 } } \cs_new_protected:Npn \driver_box_use_rotate:Nn #1#2 + { \exp_args:NNf \__driver_box_use_rotate:Nn #1 { \fp_eval:n {#2} } } +\cs_new_protected:Npn \__driver_box_use_rotate:Nn #1#2 { \__driver_scope_begin: - \tex_special:D + \__driver_literal:x { x:rotate~ \fp_compare:nNnTF {#2} = \c_zero_fp @@ -96,7 +117,7 @@ \cs_new_protected:Npn \driver_box_use_scale:Nnn #1#2#3 { \__driver_scope_begin: - \tex_special:D + \__driver_literal:x { x:scale~ \fp_eval:n { round ( #2 , 5 ) } ~ @@ -109,7 +130,7 @@ \int_new:N \g__driver_image_int \cs_new_protected:Npn \__driver_image_include_eps:n #1 { - \tex_special:D { PSfile = #1 } + \__driver_literal:n { PSfile = #1 } } \cs_new_protected:Npn \__driver_image_include_jpg:n #1 { \__driver_image_include_auxi:nn {#1} { image } } @@ -133,7 +154,7 @@ { \int_if_exist:cTF { c__driver_image_ #2#1 _int } { - \tex_special:D + \__driver_literal:x { pdf:usexobj~@image \int_use:c { c__driver_image_ #2#1 _int } } } { \__driver_image_include_auxiii:nn {#2} {#1} {#3} } @@ -143,7 +164,7 @@ { \int_gincr:N \g__driver_image_int \int_const:cn { c__driver_image_ #1#2 _int } { \g__driver_image_int } - \tex_special:D + \__driver_literal:x { pdf:#3~ @image \int_use:c { c__driver_image_ #1#2 _int } @@ -230,16 +251,14 @@ { page~ \int_use:N \l_image_page_int } \__driver_image_getbb_auxiv:VnNnn \l_image_pagebox_tl } -\cs_new_eq:NN \__driver_draw_literal:n \__driver_literal:n +\cs_new_eq:NN \__driver_draw_literal:n \__driver_literal_pdf:n \cs_generate_variant:Nn \__driver_draw_literal:n { x } \cs_new_protected:Npn \driver_draw_begin: { \driver_draw_scope_begin: } \cs_new_protected:Npn \driver_draw_end: { \driver_draw_scope_end: } -\cs_new_protected:Npn \driver_draw_scope_begin: - { \__driver_draw_literal:n { q } } -\cs_new_protected:Npn \driver_draw_scope_end: - { \__driver_draw_literal:n { Q } } +\cs_new_eq:NN \driver_draw_scope_begin: \__driver_scope_begin: +\cs_new_eq:NN \driver_draw_scope_end: \__driver_scope_end: \cs_new_protected:Npn \driver_draw_moveto:nn #1#2 { \__driver_draw_literal:x @@ -297,25 +316,26 @@ } \cs_new_protected:Npn \driver_draw_discardpath: { \__driver_draw_literal:n { n } } -\cs_new_protected:Npn \driver_draw_cap_dash:nn #1#2 +\cs_new_protected:Npn \driver_draw_dash_pattern:nn #1#2 { \__driver_draw_literal:x { - [ ~ - \clist_map_function:nN {#1} \__driver_draw_dash:n + [ + \exp_args:Nf \use:n + { \clist_map_function:nN {#1} \__driver_draw_dash:n } ] ~ \dim_to_decimal_in_bp:n {#2} ~ d } } \cs_new:Npn \__driver_draw_dash:n #1 - { \dim_to_decimal_in_bp:n {#1} ~ } + { ~ \dim_to_decimal_in_bp:n {#1} } \cs_new_protected:Npn \driver_draw_linewidth:n #1 { \__driver_draw_literal:x { \dim_to_decimal_in_bp:n {#1} ~ w } } \cs_new_protected:Npn \driver_draw_miterlimit:n #1 - { \__driver_draw_literal:x { #1 ~ M } } + { \__driver_draw_literal:x { \fp_eval:n {#1} ~ M } } \cs_new_protected:Npn \driver_draw_cap_butt: { \__driver_draw_literal:n { 0 ~ J } } \cs_new_protected:Npn \driver_draw_cap_round: @@ -329,18 +349,39 @@ \cs_new_protected:Npn \driver_draw_join_bevel: { \__driver_draw_literal:n { 2 ~ j } } \cs_new_protected:Npn \driver_draw_color_fill_cmyk:nnnn #1#2#3#4 - { \__driver_color_fill_select:n { #1 ~ #2 ~ #3 ~ #4 ~ k } } + { + \__driver_color_fill_select:x + { + \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ + \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ + k + } + } \cs_new_protected:Npn \driver_draw_color_stroke_cmyk:nnnn #1#2#3#4 - { \__driver_color_select:n { #1 ~ #2 ~ #3 ~ #4 ~ K } } + { + \__driver_color_select:x + { + \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ + \fp_eval:n {#3} ~ \fp_eval:n {#4} ~ + k + } + } \cs_new_protected:Npn \driver_draw_color_fill_gray:n #1 - { \__driver_color_fill_select:n { #1 ~ g } } + { \__driver_color_fill_select:x { \fp_eval:n {#1} ~ g } } \cs_new_protected:Npn \driver_draw_color_stroke_gray:n #1 - { \__driver_color_select:n { #1 ~ G } } + { \__driver_color_select:x { \fp_eval:n {#1} ~ G } } \cs_new_protected:Npn \driver_draw_color_fill_rgb:nnn #1#2#3 - { \__driver_color_fill_select:n { #1 ~ #2 ~ #3 ~ rg } } + { + \__driver_color_fill_select:x + { \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ rg } + } \cs_new_protected:Npn \driver_draw_color_stroke_rgb:nnn #1#2#3 - { \__driver_color_select:n { #1 ~ #2 ~ #3 ~ RG } } + { + \__driver_color_select:x + { \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ RG } + } \cs_new_eq:NN \__driver_color_fill_select:n \__driver_draw_literal:n +\cs_generate_variant:Nn \__driver_color_fill_select:n { x } \cs_new_protected:Npn \driver_draw_cm:nnnn #1#2#3#4 { \__driver_draw_cm_decompose:nnnnN {#1} {#2} {#3} {#4} @@ -348,20 +389,20 @@ } \cs_new_protected:Npn \__driver_draw_cm:nnnn #1#2#3#4 { - \tex_special:D + \__driver_literal:x { x:rotate~ \fp_compare:nNnTF {#1} = \c_zero_fp { 0 } { \fp_eval:n { round ( -#1 , 5 ) } } } - \tex_special:D + \__driver_literal:x { x:scale~ \fp_eval:n { round ( #2 , 5 ) } ~ \fp_eval:n { round ( #3 , 5 ) } } - \tex_special:D + \__driver_literal:x { x:rotate~ \fp_compare:nNnTF {#4} = \c_zero_fp @@ -414,9 +455,15 @@ \cs_new_protected:Npn \driver_draw_box_use:Nnnnn #1#2#3#4#5 { \__driver_scope_begin: - \tex_special:D { pdf:btrans~matrix~ #2 ~ #3 ~ #4 ~ #5 ~ 0 ~ 0 } + \__driver_literal:x + { + pdf:btrans~matrix~ + \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ + \fp_eval:n {#4} ~ \fp_eval:n {#5} ~ + 0 ~ 0 + } \hbox_overlap_right:n { \box_use:N #1 } - \tex_special:D { pdf:etrans } + \__driver_literal:n { pdf:etrans } \__driver_scope_end: } %% |