summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def126
1 files changed, 84 insertions, 42 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
index a3448270a51..d72da1a8865 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def
@@ -18,7 +18,7 @@
%% This file is part of the "l3kernel bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
-%% File: l3drivers.dtx Copyright(C) 2011-2017 The LaTeX3 Project
+%% File: l3drivers.dtx Copyright(C) 2011-2018 The LaTeX3 Project
\ProvidesExplFile
{l3xdvidpfmx.def}{2017/03/18}{}
{L3 Experimental driver: xdvipdfmx}
@@ -51,10 +51,13 @@
\cs_new_protected:Npn \driver_color_rgb:nnn #1#2#3
{ \__driver_color_select:n { rgb~ #1 ~ #2 ~ #3 } }
\cs_new_protected:Npn \driver_color_spot:nn #1#2
- { \__driver_color_select:n { color~push~\c_space_tl #1 } }
+ { \__driver_color_select:n { \c_space_tl #1 } }
\cs_new_protected:Npn \__driver_color_select:n #1
- { \tex_special:D { color~push~ #1 } }
-\cs_new_protected:Npn \driver_color_reset:
+ {
+ \tex_special:D { color~push~ #1 }
+ \group_insert_after:N \__driver_color_reset:
+ }
+\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 } }
@@ -325,58 +328,97 @@
{ \__driver_draw_literal:n { 1 ~ j } }
\cs_new_protected:Npn \driver_draw_join_bevel:
{ \__driver_draw_literal:n { 2 ~ j } }
-\cs_new_protected:Npn \driver_draw_color_cmyk:nnnn #1#2#3#4
+\cs_new_protected:Npn \driver_draw_color_fill_cmyk:nnnn #1#2#3#4
+ { \__driver_color_fill_select:n { #1 ~ #2 ~ #3 ~ #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 } }
+\cs_new_protected:Npn \driver_draw_color_fill_gray:n #1
+ { \__driver_color_fill_select:n { #1 ~ g } }
+\cs_new_protected:Npn \driver_draw_color_stroke_gray:n #1
+ { \__driver_color_select: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 } }
+\cs_new_protected:Npn \driver_draw_color_stroke_rgb:nnn #1#2#3
+ { \__driver_color_select:n { #1 ~ #2 ~ #3 ~ RG } }
+\cs_new_eq:NN \__driver_color_fill_select:n \__driver_draw_literal:n
+\cs_new_protected:Npn \driver_draw_cm:nnnn #1#2#3#4
{
- \__driver_draw_literal:n
- { #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K }
+ \__driver_draw_cm_decompose:nnnnN {#1} {#2} {#3} {#4}
+ \__driver_draw_cm:nnnn
}
-\cs_new_protected:Npn \driver_draw_fill_cmyk:nnnn #1#2#3#4
+\cs_new_protected:Npn \__driver_draw_cm:nnnn #1#2#3#4
{
- \__driver_draw_literal:n { #1 ~ #2 ~ #3 ~ #4 ~ k }
+ \tex_special:D
+ {
+ x:rotate~
+ \fp_compare:nNnTF {#1} = \c_zero_fp
+ { 0 }
+ { \fp_eval:n { round ( -#1 , 5 ) } }
+ }
+ \tex_special:D
+ {
+ x:scale~
+ \fp_eval:n { round ( #2 , 5 ) } ~
+ \fp_eval:n { round ( #3 , 5 ) }
+ }
+ \tex_special:D
+ {
+ x:rotate~
+ \fp_compare:nNnTF {#4} = \c_zero_fp
+ { 0 }
+ { \fp_eval:n { round ( -#4 , 5 ) } }
+ }
}
-\cs_new_protected:Npn \driver_draw_stroke_cmyk:nnnn #1#2#3#4
- { \__driver_draw_literal:n { #1 ~ #2 ~ #3 ~ #4 ~ K } }
-\cs_new_protected:Npn \driver_draw_color_gray:n #1
- { \__driver_draw_literal:n { #1 ~ g ~ #1 ~ G } }
-\cs_new_protected:Npn \driver_draw_fill_gray:n #1
- { \__driver_draw_literal:n { #1 ~ g } }
-\cs_new_protected:Npn \driver_draw_stroke_gray:n #1
- { \__driver_draw_literal:n { #1 ~ G } }
-\cs_new_protected:Npn \driver_draw_color_rgb:nnn #1#2#3
+\cs_new_protected:Npn \__driver_draw_cm_decompose:nnnnN #1#2#3#4#5
{
- \__driver_draw_literal:n
- { #1 ~ #2 ~ #3 ~ rg ~ #1 ~ #2 ~ #3 ~ RG }
+ \use:x
+ {
+ \__driver_draw_cm_decompose_auxi:nnnnN
+ { \fp_eval:n { (#1 + #4) / 2 } }
+ { \fp_eval:n { (#1 - #4) / 2 } }
+ { \fp_eval:n { (#3 + #2) / 2 } }
+ { \fp_eval:n { (#3 - #2) / 2 } }
+ }
+ #5
}
-\cs_new_protected:Npn \driver_draw_fill_rgb:nnn #1#2#3
- { \__driver_draw_literal:n { #1 ~ #2 ~ #3 ~ rg } }
-\cs_new_protected:Npn \driver_draw_stroke_rgb:nnn #1#2#3
- { \__driver_draw_literal:n { #1 ~ #2 ~ #3 ~ RG } }
-\cs_new_protected:Npn \driver_draw_transformcm:nnnnnn #1#2#3#4#5#6
+\cs_new_protected:Npn \__driver_draw_cm_decompose_auxi:nnnnN #1#2#3#4#5
{
- \__driver_draw_literal:x
+ \use:x
{
- #1 ~ #2 ~ #3 ~ #4 ~
- \dim_to_decimal_in_bp:n {#5} ~ \dim_to_decimal_in_bp:n {#6} ~
- cm
+ \__driver_draw_cm_decompose_auxii:nnnnN
+ { \fp_eval:n { 2 * sqrt ( #1 * #1 + #4 * #4 ) } }
+ { \fp_eval:n { 2 * sqrt ( #2 * #2 + #3 * #3 ) } }
+ { \fp_eval:n { atand ( #3 , #2 ) } }
+ { \fp_eval:n { atand ( #4 , #1 ) } }
}
+ #5
}
-\cs_new_protected:Npn \driver_draw_hbox:Nnnnnnn #1#2#3#4#5#6#7
+\cs_new_protected:Npn \__driver_draw_cm_decompose_auxii:nnnnN #1#2#3#4#5
{
- \hbox_set:Nn \l__driver_tmp_box
+ \use:x
{
- \tex_kern:D \__dim_eval:n {#6}
- \__driver_scope_begin:
- \driver_draw_transformcm:nnnnnn {#2} {#3} {#4} {#5}
- { 0pt } { 0pt }
- \box_move_up:nn {#7} { \box_use:N #1 }
- \__driver_scope_end:
+ \__driver_draw_cm_decompose_auxiii:nnnnN
+ { \fp_eval:n { ( #4 - #3 ) / 2 } }
+ { \fp_eval:n { ( #1 + #2 ) / 2 } }
+ { \fp_eval:n { ( #1 - #2 ) / 2 } }
+ { \fp_eval:n { ( #4 + #3 ) / 2 } }
}
- \box_set_wd:Nn \l__driver_tmp_box { 0pt }
- \box_set_ht:Nn \l__driver_tmp_box { 0pt }
- \box_set_dp:Nn \l__driver_tmp_box { 0pt }
- \box_use:N \l__driver_tmp_box
+ #5
+ }
+\cs_new_protected:Npn \__driver_draw_cm_decompose_auxiii:nnnnN #1#2#3#4#5
+ {
+ \fp_compare:nNnTF { abs( #2 ) } > { abs ( #3 ) }
+ { #5 {#1} {#2} {#3} {#4} }
+ { #5 {#1} {#3} {#2} {#4} }
+ }
+\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 }
+ \hbox_overlap_right:n { \box_use:N #1 }
+ \tex_special:D { pdf:etrans }
+ \__driver_scope_end:
}
-\box_new:N \l__driver_tmp_box
%%
%%
%% End of file `l3xdvipdfmx.def'.