diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def | 90 |
1 files changed, 46 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def index 0c905c2845a..59dc81cc5ce 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvipdfmx.def @@ -46,22 +46,37 @@ %% %% ----------------------------------------------------------------------- %% -\GetIdInfo$Id: l3drivers.dtx 6472 2016-04-05 13:26:17Z joseph $ +\GetIdInfo$Id: l3drivers.dtx 6494 2016-05-14 21:10:56Z joseph $ {L3 Experimental drivers} \ProvidesExplFile {l3dvidpfmx.def}{\ExplFileDate}{\ExplFileVersion} {L3 Experimental driver: dvipdfmx} -\cs_new_protected_nopar:Npx \__driver_state_save: - { \tex_special:D { pdf:literal~q } } -\cs_new_protected_nopar:Npx \__driver_state_restore: - { \tex_special:D { pdf:literal~Q } } -\cs_new_protected:Npx \__driver_literal:n #1 +\cs_new_protected:Npn \__driver_literal:n #1 { \tex_special:D { pdf:literal~ #1 } } -\cs_new_protected:Npx \__driver_matrix:n #1 +\cs_new_protected_nopar:Npn \__driver_scope_begin: + { \__driver_literal:n { q } } +\cs_new_protected_nopar:Npn \__driver_scope_end: + { \__driver_literal:n { Q } } +\cs_new_protected:Npn \__driver_matrix:n #1 { \__driver_literal:n { #1 \c_space_tl 0~0~cm } } +\tl_new:N \l__driver_current_color_tl +\tl_set:Nn \l__driver_current_color_tl { [ 0 ] } +\AtBeginDocument + { + \@ifpackageloaded { color } + { \tl_set:Nn \l__driver_current_color_tl { \current@color } } + { } + } +\cs_new_protected_nopar:Npx \__driver_color_ensure_current: + { + \tex_special:D { pdf:bcolor~\l__driver_current_color_tl } + \group_insert_after:N \exp_not:N \__driver_color_reset: + } +\cs_new_protected_nopar:Npx \__driver_color_reset: + { \tex_special:D { pdf:ecolor } } \cs_new_protected:Npn \__driver_box_use_clip:N #1 { - \__driver_state_save: + \__driver_scope_begin: \__driver_literal:n { 0~ @@ -71,60 +86,47 @@ re~W~n } \hbox_overlap_right:n { \box_use:N #1 } - \__driver_state_restore: + \__driver_scope_end: \skip_horizontal:n { \box_wd:N #1 } } -\cs_new_protected_nopar:Npn \__driver_box_rotate_begin: +\cs_new_protected:Npn \__driver_box_use_rotate:Nn #1#2 { - \__driver_state_save: - \box_set_wd:Nn \l__box_internal_box \c_zero_dim - \fp_set:Nn \l__box_cos_fp { round ( \l__box_cos_fp , 5 ) } - \fp_compare:nNnT \l__box_cos_fp = \c_zero_fp - { \fp_zero:N \l__box_cos_fp } - \fp_set:Nn \l__box_sin_fp { round ( \l__box_sin_fp , 5 ) } + \__driver_scope_begin: + \box_set_wd:Nn #1 \c_zero_dim + \fp_set:Nn \l__driver_cos_fp { round ( cosd ( #2 ) , 5 ) } + \fp_compare:nNnT \l__driver_cos_fp = \c_zero_fp + { \fp_zero:N \l__driver_cos_fp } + \fp_set:Nn \l__driver_sin_fp { round ( sind ( #2 ) , 5 ) } \__driver_matrix:n { - \fp_use:N \l__box_cos_fp \c_space_tl - \fp_compare:nNnTF \l__box_sin_fp = \c_zero_fp + \fp_use:N \l__driver_cos_fp \c_space_tl + \fp_compare:nNnTF \l__driver_sin_fp = \c_zero_fp { 0~0 } { - \fp_use:N \l__box_sin_fp + \fp_use:N \l__driver_sin_fp \c_space_tl - \fp_eval:n { -\l__box_sin_fp } + \fp_eval:n { -\l__driver_sin_fp } } \c_space_tl - \fp_use:N \l__box_cos_fp + \fp_use:N \l__driver_cos_fp } + \box_use:N #1 + \__driver_scope_end: } -\cs_new_eq:NN \__driver_box_rotate_end: \__driver_state_restore: -\cs_new_protected_nopar:Npn \__driver_box_scale_begin: +\fp_new:N \l__driver_cos_fp +\fp_new:N \l__driver_sin_fp +\cs_new_protected:Npn \__driver_box_use_scale:Nnn #1#2#3 { - \__driver_state_save: - \fp_set:Nn \l__box_scale_x_fp { round ( \l__box_scale_x_fp , 5 ) } - \fp_set:Nn \l__box_scale_y_fp { round ( \l__box_scale_y_fp , 5 ) } + \__driver_scope_begin: \__driver_matrix:n { - \fp_use:N \l__box_scale_x_fp \c_space_tl + \fp_eval:n { round ( #2 , 5 ) } ~ 0~0~ - \fp_use:N \l__box_scale_y_fp + \fp_eval:n { round ( #3 , 5 ) } } + \hbox_overlap_right:n { \box_use:N #1 } + \__driver_scope_end: } -\cs_new_eq:NN \__driver_box_scale_end: \__driver_state_restore: -\tl_new:N \l__driver_current_color_tl -\tl_set:Nn \l__driver_current_color_tl { gray~0 } -\AtBeginDocument - { - \@ifpackageloaded { color } - { \tl_set:Nn \l__driver_current_color_tl { \current@color } } - { } - } -\cs_new_protected_nopar:Npx \__driver_color_ensure_current: - { - \tex_special:D { color~push~\exp_not:N \l__driver_current_color_tl } - \group_insert_after:N \exp_not:N \__driver_color_reset: - } -\cs_new_protected_nopar:Npx \__driver_color_reset: - { \tex_special:D { color~pop } } %% %% %% End of file `l3dvipdfmx.def'. |