diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def | 78 |
1 files changed, 50 insertions, 28 deletions
diff --git a/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def b/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def index 3cd59d4ffa3..d446e114be2 100644 --- a/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def +++ b/Master/texmf-dist/tex/latex/l3kernel/l3dvisvgm.def @@ -20,8 +20,12 @@ %% %% File: l3drivers.dtx Copyright(C) 2011-2018 The LaTeX3 Project \ProvidesExplFile - {l3dvisvgm.def}{2017/03/18}{} + {l3dvisvgm.def}{2018-04-30}{} {L3 Experimental driver: dvisvgm} +\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,34 +52,47 @@ { } } \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 { dvisvgm:raw~ #1 { ?nl } } } + { \__driver_literal:n { color~pop } } +\cs_new_protected:Npn \__driver_literal_svg:n #1 + { \__driver_literal:n { dvisvgm:raw~ #1 { ?nl } } } +\cs_generate_variant:Nn \__driver_literal_svg:n { x } \cs_new_protected:Npn \__driver_scope_begin: - { \__driver_literal:n { <g> } } + { \__driver_literal_svg:n { <g> } } \cs_new_protected:Npn \__driver_scope_end: - { \__driver_literal:n { </g> } } + { \__driver_literal_svg:n { </g> } } \cs_new_protected:Npn \__driver_scope_begin:n #1 - { \__driver_literal:n { <g~ #1 > } } + { \__driver_literal_svg:n { <g~ #1 > } } +\cs_generate_variant:Nn \__driver_scope_begin:n { x } \cs_new_protected:Npn \driver_box_use_clip:N #1 { \int_gincr:N \g__driver_clip_path_int - \__driver_literal:n + \__driver_literal_svg:x { < clipPath~id = " l3cp \int_use:N \g__driver_clip_path_int " > } - \__driver_literal:n + \__driver_literal_svg:x { < path ~ d = @@ -89,7 +109,7 @@ " /> } - \__driver_literal:n + \__driver_literal_svg:n { < /clipPath > } \__driver_scope_begin:n { @@ -99,9 +119,10 @@ scale ( 1 , -1 ) " } - \__driver_scope_begin:n + \__driver_scope_begin:x { - clip-path = "url ( \c_hash_str l3cp \int_use:N \g__driver_clip_path_int ) " + clip-path = + "url ( \c_hash_str l3cp \int_use:N \g__driver_clip_path_int ) " } \__driver_scope_begin:n { @@ -120,12 +141,12 @@ \int_new:N \g__driver_clip_path_int \cs_new_protected:Npn \driver_box_use_rotate:Nn #1#2 { - \__driver_scope_begin:n + \__driver_scope_begin:x { transform = " rotate - ( \fp_eval:n { round ( -#2 , 5 ) } , ~ { ?x } , ~ { ?y } ) + ( \fp_eval:n { round ( -(#2) , 5 ) } , ~ { ?x } , ~ { ?y } ) " } \box_use:N #1 @@ -133,7 +154,7 @@ } \cs_new_protected:Npn \driver_box_use_scale:Nnn #1#2#3 { - \__driver_scope_begin:n + \__driver_scope_begin:x { transform = " @@ -154,7 +175,7 @@ \cs_new_eq:NN \__driver_image_getbb_jpg:n \image_extract_bb:n \cs_new_protected:Npn \__driver_image_include_png:n #1 { - \tex_special:D + \__driver_literal:x { dvisvgm:img~ \dim_to_decimal:n { \l_image_ury_dim } ~ @@ -163,8 +184,9 @@ } } \cs_new_eq:NN \__driver_image_include_jpg:n \__driver_image_include_png:n -\cs_new:Npn \__driver_image_include_bitmap_quote:w #1 " #2 " #3 \q_stop { #1#2 } -\cs_new_eq:NN \__driver_draw_literal:n \__driver_literal:n +\cs_new:Npn \__driver_image_include_bitmap_quote:w #1 " #2 " #3 \q_stop + { #1#2 } +\cs_new_eq:NN \__driver_draw_literal:n \__driver_literal_svg:n \cs_generate_variant:Nn \__driver_draw_literal:n { x } \cs_new_protected:Npn \driver_draw_begin: { @@ -312,7 +334,7 @@ \tl_gclear:N \g__driver_draw_path_tl \bool_gset_false:N \g__driver_draw_clip_bool } -\cs_new_protected:Npn \driver_draw_cap_dash:nn #1#2 +\cs_new_protected:Npn \driver_draw_dash_pattern:nn #1#2 { \use:x { @@ -339,7 +361,7 @@ \cs_new_protected:Npn \driver_draw_linewidth:n #1 { \__driver_draw_scope:x { stroke-width=" \dim_to_decimal:n {#1} " } } \cs_new_protected:Npn \driver_draw_miterlimit:n #1 - { \__driver_draw_scope:x { stroke-miterlimit=" #1 " } } + { \__driver_draw_scope:x { stroke-miterlimit=" \fp_eval:n {#1} " } } \cs_new_protected:Npn \driver_draw_cap_butt: { \__driver_draw_scope:n { stroke-linecap="butt" } } \cs_new_protected:Npn \driver_draw_cap_round: @@ -415,11 +437,11 @@ " } } -\cs_new_protected:Npn \driver_draw_hbox:Nnnnnnn #1#2#3#4#5#6#7 +\cs_new_protected:Npn \driver_draw_box_use:Nnnnn #1#2#3#4#5#6#7 { \__driver_scope_begin: \driver_draw_cm:nnnn {#2} {#3} {#4} {#5} - \__driver_literal:n + \__driver_literal_svg:n { < g~ stroke="none"~ @@ -430,7 +452,7 @@ \box_set_ht:Nn #1 { 0pt } \box_set_dp:Nn #1 { 0pt } \box_use:N #1 - \__driver_literal:n { </g> } + \__driver_literal_svg:n { </g> } \__driver_scope_end: } %% |