summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def')
-rw-r--r--Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def109
1 files changed, 84 insertions, 25 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
index d321543bcae..85caa134571 100644
--- a/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
+++ b/Master/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
@@ -20,8 +20,12 @@
%%
%% File: l3drivers.dtx Copyright(C) 2011-2018 The LaTeX3 Project
\ProvidesExplFile
- {l3pdfmode.def}{2017/03/18}{}
+ {l3pdfmode.def}{2018-04-30}{}
{L3 Experimental driver: PDF mode}
+\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
{
@@ -60,10 +64,36 @@
}
\int_new:N \l__driver_color_stack_int
\cs_new_protected:Npn \driver_color_cmyk:nnnn #1#2#3#4
- { \__driver_color_select:n { #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K } }
+ {
+ \use:x
+ {
+ \__driver_color_cmyk:nnnn
+ { \fp_eval:n {#1} }
+ { \fp_eval:n {#2} }
+ { \fp_eval:n {#3} }
+ { \fp_eval:n {#4} }
+ }
+ }
+\cs_new_protected:Npn \__driver_color_cmyk:nnnn #1#2#3#4
+ {
+ \__driver_color_select:n
+ { #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K }
+ }
\cs_new_protected:Npn \driver_color_gray:n #1
+ { \exp_args:Nx \__driver_color_gray:n { \fp_eval:n {#1} } }
+\cs_new_protected:Npn \__driver_color_gray:n #1
{ \__driver_color_select:n { #1 ~ g ~ #1 ~ G } }
\cs_new_protected:Npn \driver_color_rgb:nnn #1#2#3
+ {
+ \use:x
+ {
+ \__driver_color_rgb:nnn
+ { \fp_eval:n {#1} }
+ { \fp_eval:n {#2} }
+ { \fp_eval:n {#3} }
+ }
+ }
+\cs_new_protected:Npn \__driver_color_rgb:nnn #1#2#3
{ \__driver_color_select:n { #1 ~ #2 ~ #3 ~ rg ~ #1 ~ #2 ~ #3 ~ RG } }
\cs_new_protected:Npn \driver_color_spot:nn #1#2
{ \__driver_color_select:n { /#1 ~ cs ~ /#1 ~ CS ~ #2 ~ sc ~ #2 ~ SC } }
@@ -75,6 +105,7 @@
\exp_not:N \l__driver_color_stack_int push {#1}
\group_insert_after:N \exp_not:N \__driver_color_reset:
}
+\cs_generate_variant:Nn \__driver_color_select:n { x }
\cs_new_protected:Npx \__driver_color_reset:
{
\cs_if_exist:NTF \luatex_pdfextension:D
@@ -82,13 +113,14 @@
{ \pdftex_pdfcolorstack:D }
\exp_not:N \l__driver_color_stack_int pop \scan_stop:
}
-\cs_new_protected:Npx \__driver_literal:n #1
+\cs_new_protected:Npx \__driver_literal_pdf:n #1
{
\cs_if_exist:NTF \luatex_pdfextension:D
{ \luatex_pdfextension:D literal }
{ \pdftex_pdfliteral:D }
- {#1}
+ { \exp_not:N \exp_not:n {#1} }
}
+\cs_generate_variant:Nn \__driver_literal_pdf:n { x }
\cs_new_protected:Npx \__driver_scope_begin:
{
\cs_if_exist:NTF \luatex_pdfextension:D
@@ -106,12 +138,13 @@
\cs_if_exist:NTF \luatex_pdfextension:D
{ \luatex_pdfextension:D setmatrix }
{ \pdftex_pdfsetmatrix:D }
- {#1}
+ { \exp_not:N \exp_not:n {#1} }
}
+\cs_generate_variant:Nn \__driver_matrix:n { x }
\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 } ~
@@ -124,6 +157,8 @@
\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:
\box_set_wd:Nn #1 { 0pt }
@@ -131,7 +166,7 @@
\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
+ \__driver_matrix:x
{
\fp_use:N \l__driver_cos_fp \c_space_tl
\fp_compare:nNnTF \l__driver_sin_fp = \c_zero_fp
@@ -152,7 +187,7 @@
\cs_new_protected:Npn \driver_box_use_scale:Nnn #1#2#3
{
\__driver_scope_begin:
- \__driver_matrix:n
+ \__driver_matrix:x
{
\fp_eval:n { round ( #2 , 5 ) } ~
0~0~
@@ -229,16 +264,14 @@
}
\cs_new_eq:NN \__driver_image_include_pdf:n \__driver_image_include_jpg:n
\cs_new_eq:NN \__driver_image_include_png:n \__driver_image_include_jpg:n
-\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
@@ -296,25 +329,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:
@@ -328,21 +362,46 @@
\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_color_select:n
+\cs_generate_variant:Nn \__driver_color_fill_select:n { x }
\cs_new_protected:Npn \driver_draw_cm:nnnn #1#2#3#4
{
- \__driver_matrix:n { #1 ~ #2 ~ #3 ~ #4 }
+ \__driver_matrix:x
+ {
+ \fp_eval:n {#1} ~ \fp_eval:n {#2} ~
+ \fp_eval:n {#3} ~ \fp_eval:n {#4}
+ }
}
\cs_new_protected:Npn \driver_draw_box_use:Nnnnn #1#2#3#4#5
{