summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/l3backend/l3backend-xetex.def')
-rw-r--r--Master/texmf-dist/tex/latex/l3backend/l3backend-xetex.def306
1 files changed, 136 insertions, 170 deletions
diff --git a/Master/texmf-dist/tex/latex/l3backend/l3backend-xetex.def b/Master/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
index d6de9539313..dd69cc589db 100644
--- a/Master/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
+++ b/Master/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
@@ -26,7 +26,7 @@
%%
%% File: l3backend-basics.dtx
\ProvidesExplFile
- {l3backend-xetex.def}{2022-02-07}{}
+ {l3backend-xetex.def}{2022-04-10}{}
{L3 backend support: XeTeX}
\cs_if_exist:NTF \__kernel_dependency_version_check:nn
{
@@ -65,20 +65,6 @@
{ \__kernel_backend_literal:n { x:gsave } }
\cs_new_protected:Npn \__kernel_backend_scope_end:
{ \__kernel_backend_literal:n { x:grestore } }
-\group_begin:
- \cs_set:Npn \__sys_tmp:w #1 Version ~ #2 ~ #3 \q_stop {#2}
- \sys_get_shell:nnNTF { extractbb~--version }
- { \char_set_catcode_space:n { `\ } }
- \l__sys_internal_tl
- {
- \int_const:Nn \c__kernel_sys_dvipdfmx_version_int
- {
- \exp_after:wN \__sys_tmp:w \l__sys_internal_tl
- \q_stop
- }
- }
- { \int_const:Nn \c__kernel_sys_dvipdfmx_version_int { 0 } }
-\group_end:
%% File: l3backend-color.dtx
\cs_new_protected:Npn \__color_backend_pickup:N #1 { }
\cs_if_exist:cT { ver@color.sty }
@@ -102,71 +88,64 @@
{ \tl_set:Nn #3 { {#1} {#2} } }
}
\int_new:N \l__color_backend_stack_int
-\int_compare:nNnTF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- { \cs_new_protected:Npn \__kernel_color_backend_stack_init:Nnn #1#2#3 { } }
+\int_new:N \g__color_backend_stack_int
+\cs_new_protected:Npx \__kernel_color_backend_stack_init:Nnn #1#2#3
{
- \int_new:N \g__color_backend_stack_int
- \cs_new_protected:Npx \__kernel_color_backend_stack_init:Nnn #1#2#3
+ \int_gincr:N \exp_not:N \g__color_backend_stack_int
+ \int_const:Nn #1 { \exp_not:N \g__color_backend_stack_int }
+ \use:x
{
- \int_gincr:N \exp_not:N \g__color_backend_stack_int
- \int_const:Nn #1 { \exp_not:N \g__color_backend_stack_int }
- \use:x
+ \__kernel_backend_first_shipout:n
{
- \__kernel_backend_first_shipout:n
+ \__kernel_backend_literal:n
{
- \__kernel_backend_literal:n
- {
- pdfcolorstackinit ~
- \exp_not:N \int_use:N \exp_not:N \g__color_backend_stack_int
- \c_space_tl
- \exp_not:N \tl_if_blank:nF {#2} { #2 ~ }
- (#3)
- }
+ pdfcolorstackinit ~
+ \exp_not:N \int_use:N \exp_not:N \g__color_backend_stack_int
+ \c_space_tl
+ \exp_not:N \tl_if_blank:nF {#2} { #2 ~ }
+ (#3)
}
- }
- }
- \cs_if_exist:cTF { main@pdfcolorstack }
- {
- \int_set:Nn \l__color_backend_stack_int
- { \int_use:c { main@pdfcolorstack } }
+ }
}
+ }
+\cs_if_exist:cTF { main@pdfcolorstack }
+ {
+ \int_set:Nn \l__color_backend_stack_int
+ { \int_use:c { main@pdfcolorstack } }
+ }
+ {
+ \__kernel_color_backend_stack_init:Nnn \c__color_backend_main_stack_int
+ { page ~ direct } { 0 ~ g ~ 0 ~ G }
+ \int_set_eq:NN \l__color_backend_stack_int
+ \c__color_backend_main_stack_int
+ \int_const:cn { main@pdfcolorstack } { \c__color_backend_main_stack_int }
+ }
+\cs_gset_protected:Npn \__kernel_backend_scope_end:
+ {
+ \__kernel_backend_literal:n { x:grestore }
+ \__kernel_backend_literal:x
{
- \__kernel_color_backend_stack_init:Nnn \c__color_backend_main_stack_int
- { page ~ direct } { 0 ~ g ~ 0 ~ G }
- \int_set_eq:NN \l__color_backend_stack_int
- \c__color_backend_main_stack_int
- \int_const:cn { main@pdfcolorstack } { \c__color_backend_main_stack_int }
+ pdfcolorstack ~
+ \int_use:N \g__color_backend_stack_int \c_space_tl current
}
- \cs_gset_protected:Npn \__kernel_backend_scope_end:
+ }
+\cs_new_protected:Npn \__kernel_color_backend_stack_push:nn #1#2
+ {
+ \__kernel_backend_literal:x
{
- \__kernel_backend_literal:n { x:grestore }
- \__kernel_backend_literal:x
- {
- pdfcolorstack ~
- \int_use:N \g__color_backend_stack_int \c_space_tl current
- }
+ pdfcolorstack ~
+ \int_eval:n {#1} ~
+ push ~ (#2)
}
}
-\int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
+\cs_generate_variant:Nn \__kernel_color_backend_stack_push:nn { nx }
+\cs_new_protected:Npn \__kernel_color_backend_stack_pop:n #1
{
- \cs_new_protected:Npn \__kernel_color_backend_stack_push:nn #1#2
+ \__kernel_backend_literal:x
{
- \__kernel_backend_literal:x
- {
- pdfcolorstack ~
- \int_eval:n {#1} ~
- push ~ (#2)
- }
- }
- \cs_generate_variant:Nn \__kernel_color_backend_stack_push:nn { nx }
- \cs_new_protected:Npn \__kernel_color_backend_stack_pop:n #1
- {
- \__kernel_backend_literal:x
- {
- pdfcolorstack ~
- \int_eval:n {#1} ~
- pop
- }
+ pdfcolorstack ~
+ \int_eval:n {#1} ~
+ pop
}
}
\tl_new:N \l__color_backend_fill_tl
@@ -185,15 +164,6 @@
}
\cs_new_protected:Npn \__color_backend_reset:
{ \__kernel_color_backend_stack_pop:n \l__color_backend_stack_int }
-\int_compare:nNnT \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- \cs_gset_protected:Npn \__color_backend_select_cmyk:n #1
- { \__kernel_backend_literal:n { pdf: bc ~ [#1] } }
- \cs_gset_eq:NN \__color_backend_select_gray:n \__color_backend_select_cmyk:n
- \cs_gset_eq:NN \__color_backend_select_rgb:n \__color_backend_select_cmyk:n
- \cs_gset_protected:Npn \__color_backend_reset:
- { \__kernel_backend_literal:n { pdf: ec } }
- }
\prop_new:N \g__color_backend_colorant_prop
\cs_new:Npx \__color_backend_devicen_colorants:n #1
{
@@ -380,12 +350,6 @@
}
}
}
-\int_compare:nNnT \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- \cs_gset_protected:Npn \__color_backend_select_separation:nn #1#2 { }
- \cs_gset_eq:NN \__color_backend_select_devicen:nn
- \__color_backend_select_separation:nn
- }
\cs_new_protected:Npn \__color_backend_fill_cmyk:n #1
{ \__color_backend_fill:n { #1 ~ k } }
\cs_new_protected:Npn \__color_backend_fill_gray:n #1
@@ -418,27 +382,6 @@
{ \__color_backend_stroke:n { /#1 ~ CS ~ #2 ~ SCN } }
\cs_new_eq:NN \__color_backend_fill_devicen:nn \__color_backend_fill_separation:nn
\cs_new_eq:NN \__color_backend_stroke_devicen:nn \__color_backend_stroke_separation:nn
-\int_compare:nNnT \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- \cs_gset_protected:Npn \__color_backend_fill_cmyk:n #1
- {
- \__kernel_backend_literal:n { pdf: bc ~ [#1] }
- \group_insert_after:N \__color_backend_reset:
- }
- \cs_gset_eq:NN \__color_backend_fill_gray:n \__color_backend_fill_cmyk:n
- \cs_gset_eq:NN \__color_backend_fill_rgb:n \__color_backend_fill_cmyk:n
- \cs_gset_protected:Npn \__color_backend_reset:
- { \__kernel_backend_literal:n { pdf: ec } }
- \cs_gset_protected:Npn \__color_backend_stroke:n #1
- { \__kernel_backend_literal:n {#1} }
- \cs_gset_protected:Npn \__color_backend_fill_separation:nn #1#2 { }
- \cs_gset_eq:NN \__color_backend_fill_devicen:nn
- \__color_backend_fill_separation:nn
- \cs_gset_eq:NN \__color_backend_stroke_separation:nn
- \__color_backend_fill_separation:nn
- \cs_gset_eq:NN \__color_backend_stroke_devicen:nn
- \__color_backend_stroke_separation:nn
- }
%% File: l3backend-box.dtx
\cs_new_protected:Npn \__box_backend_clip:N #1
{
@@ -660,43 +603,66 @@
\__kernel_backend_scope_end:
}
%% File: l3backend-graphics.dtx
-\cs_new_eq:NN \__graphics_backend_getbb_eps:n \graphics_read_bb:n
+\cs_new_protected:Npn \__graphics_backend_loaded:n #1
+ {
+ \cs_if_exist:NTF \hook_gput_code:nnn
+ {
+ \hook_gput_code:nnn
+ { file / l3graphics.sty / after }
+ { backend }
+ {#1}
+ }
+ {#1}
+ }
+\__graphics_backend_loaded:n
+ {
+ \seq_set_from_clist:Nn \l_graphics_search_ext_seq
+ { .pdf , .eps , .ps , .png , .jpg ., jpeg , .bmp }
+ }
+\__graphics_backend_loaded:n
+ {
+ \cs_new_eq:NN \__graphics_backend_getbb_eps:n \__graphics_read_bb:n
+ \cs_new_eq:NN \__graphics_backend_getbb_ps:n \__graphics_read_bb:n
+ }
\int_new:N \g__graphics_track_int
\cs_new_protected:Npn \__graphics_backend_include_eps:n #1
{
\__kernel_backend_literal:x
{
PSfile = #1 \c_space_tl
- llx = \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl
- lly = \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl
- urx = \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl
- ury = \dim_to_decimal_in_bp:n \l_graphics_ury_dim
+ llx = \dim_to_decimal_in_bp:n \l__graphics_llx_dim \c_space_tl
+ lly = \dim_to_decimal_in_bp:n \l__graphics_lly_dim \c_space_tl
+ urx = \dim_to_decimal_in_bp:n \l__graphics_urx_dim \c_space_tl
+ ury = \dim_to_decimal_in_bp:n \l__graphics_ury_dim
}
}
+\cs_new_eq:NN \__graphics_backend_include_ps:n \__graphics_backend_include_eps:n
\cs_new_protected:Npn \__graphics_backend_include_jpg:n #1
{ \__graphics_backend_include_auxi:nn {#1} { image } }
+\cs_new_eq:NN \__graphics_backend_include_jpeg:n \__graphics_backend_include_jpg:n
\cs_new_eq:NN \__graphics_backend_include_png:n \__graphics_backend_include_jpg:n
+\cs_new_eq:NN \__graphics_backend_include_bmp:n \__graphics_backend_include_jpg:n
\cs_new_protected:Npn \__graphics_backend_include_auxi:nn #1#2
{
\__graphics_backend_include_auxii:xnn
{
- \tl_if_empty:NF \l_graphics_pagebox_tl
- { : \l_graphics_pagebox_tl }
- \int_compare:nNnT \l_graphics_page_int > 1
- { :P \int_use:N \l_graphics_page_int }
- \tl_if_empty:NF \l_graphics_decodearray_tl
- { :D \l_graphics_decodearray_tl }
- \bool_if:NT \l_graphics_interpolate_bool
+ \tl_if_empty:NF \l__graphics_pagebox_tl
+ { : \l__graphics_pagebox_tl }
+ \int_compare:nNnT \l__graphics_page_int > 1
+ { :P \int_use:N \l__graphics_page_int }
+ \tl_if_empty:NF \l__graphics_decodearray_str
+ { :D \l__graphics_decodearray_str }
+ \bool_if:NT \l__graphics_interpolate_bool
{ :I }
}
{#1} {#2}
}
\cs_new_protected:Npn \__graphics_backend_include_auxii:nnn #1#2#3
{
- \int_if_exist:cTF { c__graphics_graphics_ #2#1 _int }
+ \int_if_exist:cTF { c__graphics_ #2#1 _int }
{
\__kernel_backend_literal:x
- { pdf:usexobj~@graphic \int_use:c { c__graphics_graphics_ #2#1 _int } }
+ { pdf:usexobj~@graphic \int_use:c { c__graphics_ #2#1 _int } }
}
{ \__graphics_backend_include_auxiii:nnn {#2} {#1} {#3} }
}
@@ -704,31 +670,31 @@
\cs_new_protected:Npn \__graphics_backend_include_auxiii:nnn #1#2#3
{
\int_gincr:N \g__graphics_track_int
- \int_const:cn { c__graphics_graphics_ #1#2 _int } { \g__graphics_track_int }
+ \int_const:cn { c__graphics_ #1#2 _int } { \g__graphics_track_int }
\__kernel_backend_literal:x
{
pdf:#3~
- @graphic \int_use:c { c__graphics_graphics_ #1#2 _int } ~
- \int_compare:nNnT \l_graphics_page_int > 1
- { page ~ \int_use:N \l_graphics_page_int \c_space_tl }
- \tl_if_empty:NF \l_graphics_pagebox_tl
+ @graphic \int_use:c { c__graphics_ #1#2 _int } ~
+ \int_compare:nNnT \l__graphics_page_int > 1
+ { page ~ \int_use:N \l__graphics_page_int \c_space_tl }
+ \tl_if_empty:NF \l__graphics_pagebox_tl
{
- pagebox ~ \l_graphics_pagebox_tl \c_space_tl
+ pagebox ~ \l__graphics_pagebox_tl \c_space_tl
bbox ~
- \dim_to_decimal_in_bp:n \l_graphics_llx_dim \c_space_tl
- \dim_to_decimal_in_bp:n \l_graphics_lly_dim \c_space_tl
- \dim_to_decimal_in_bp:n \l_graphics_urx_dim \c_space_tl
- \dim_to_decimal_in_bp:n \l_graphics_ury_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l__graphics_llx_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l__graphics_lly_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l__graphics_urx_dim \c_space_tl
+ \dim_to_decimal_in_bp:n \l__graphics_ury_dim \c_space_tl
}
(#1)
\bool_lazy_or:nnT
- { \l_graphics_interpolate_bool }
- { ! \tl_if_empty_p:N \l_graphics_decodearray_tl }
+ { \l__graphics_interpolate_bool }
+ { ! \tl_if_empty_p:N \l__graphics_decodearray_str }
{
<<
- \tl_if_empty:NF \l_graphics_decodearray_tl
- { /Decode~[ \l_graphics_decodearray_tl ] }
- \bool_if:NT \l_graphics_interpolate_bool
+ \tl_if_empty:NF \l__graphics_decodearray_str
+ { /Decode~[ \l__graphics_decodearray_str ] }
+ \bool_if:NT \l__graphics_interpolate_bool
{ /Interpolate~true> }
>>
}
@@ -736,21 +702,23 @@
}
\cs_new_protected:Npn \__graphics_backend_getbb_jpg:n #1
{
- \int_zero:N \l_graphics_page_int
- \tl_clear:N \l_graphics_pagebox_tl
+ \int_zero:N \l__graphics_page_int
+ \tl_clear:N \l__graphics_pagebox_tl
\__graphics_backend_getbb_auxi:nN {#1} \tex_XeTeXpicfile:D
}
+\cs_new_eq:NN \__graphics_backend_getbb_jpeg:n \__graphics_backend_getbb_jpg:n
\cs_new_eq:NN \__graphics_backend_getbb_png:n \__graphics_backend_getbb_jpg:n
+\cs_new_eq:NN \__graphics_backend_getbb_bmp:n \__graphics_backend_getbb_jpg:n
\cs_new_protected:Npn \__graphics_backend_getbb_pdf:n #1
{
- \tl_clear:N \l_graphics_decodearray_tl
- \bool_set_false:N \l_graphics_interpolate_bool
+ \tl_clear:N \l__graphics_decodearray_str
+ \bool_set_false:N \l__graphics_interpolate_bool
\__graphics_backend_getbb_auxi:nN {#1} \tex_XeTeXpdffile:D
}
\cs_new_protected:Npn \__graphics_backend_getbb_auxi:nN #1#2
{
- \int_compare:nNnTF \l_graphics_page_int > 1
- { \__graphics_backend_getbb_auxii:VnN \l_graphics_page_int {#1} #2 }
+ \int_compare:nNnTF \l__graphics_page_int > 1
+ { \__graphics_backend_getbb_auxii:VnN \l__graphics_page_int {#1} #2 }
{ \__graphics_backend_getbb_auxiii:nNnn {#1} #2 { :P 1 } { page 1 } }
}
\cs_new_protected:Npn \__graphics_backend_getbb_auxii:nnN #1#2#3
@@ -758,8 +726,8 @@
\cs_generate_variant:Nn \__graphics_backend_getbb_auxii:nnN { V }
\cs_new_protected:Npn \__graphics_backend_getbb_auxiii:nNnn #1#2#3#4
{
- \tl_if_empty:NTF \l_graphics_pagebox_tl
- { \__graphics_backend_getbb_auxiv:VnNnn \l_graphics_pagebox_tl }
+ \tl_if_empty:NTF \l__graphics_pagebox_tl
+ { \__graphics_backend_getbb_auxiv:VnNnn \l__graphics_pagebox_tl }
{ \__graphics_backend_getbb_auxv:nNnn }
{#1} #2 {#3} {#4}
}
@@ -768,33 +736,43 @@
\use:x
{
\__graphics_backend_getbb_auxv:nNnn {#2} #3 { : #1 #4 }
- { #5 ~ \__graphics_backend_getbb_pagebox:w #1 }
+ {
+ #5
+ \tl_if_blank:nF {#1}
+ { \c_space_tl \__graphics_backend_getbb_pagebox:w #1 }
+ }
}
}
\cs_generate_variant:Nn \__graphics_backend_getbb_auxiv:nnNnn { V }
\cs_new_protected:Npn \__graphics_backend_getbb_auxv:nNnn #1#2#3#4
{
- \graphics_bb_restore:nF {#1#3}
+ \__graphics_bb_restore:nF {#1#3}
{ \__graphics_backend_getbb_auxvi:nNnn {#1} #2 {#3} {#4} }
}
\cs_new_protected:Npn \__graphics_backend_getbb_auxvi:nNnn #1#2#3#4
{
\hbox_set:Nn \l__graphics_internal_box { #2 #1 ~ #4 }
- \dim_set:Nn \l_graphics_urx_dim { \box_wd:N \l__graphics_internal_box }
- \dim_set:Nn \l_graphics_ury_dim { \box_ht:N \l__graphics_internal_box }
- \graphics_bb_save:n {#1#3}
+ \dim_set:Nn \l__graphics_urx_dim { \box_wd:N \l__graphics_internal_box }
+ \dim_set:Nn \l__graphics_ury_dim { \box_ht:N \l__graphics_internal_box }
+ \__graphics_bb_save:n {#1#3}
}
\cs_new:Npn \__graphics_backend_getbb_pagebox:w #1 box {#1}
\cs_new_protected:Npn \__graphics_backend_include_pdf:n #1
{
- \tex_XeTeXpdffile:D
- \__graphics_backend_include_pdf_quote:w #1 "#1" \s__graphics_stop \c_space_tl
- \int_compare:nNnT \l_graphics_page_int > 0
- { page ~ \int_use:N \l_graphics_page_int \c_space_tl }
- \exp_after:wN \__graphics_backend_getbb_pagebox:w \l_graphics_pagebox_tl
+ \tex_XeTeXpdffile:D #1 ~
+ \int_compare:nNnT \l__graphics_page_int > 0
+ { page ~ \int_use:N \l__graphics_page_int \c_space_tl }
+ \exp_after:wN \__graphics_backend_getbb_pagebox:w \l__graphics_pagebox_tl
+ }
+\cs_new_protected:Npn \__graphics_backend_get_pagecount:n #1
+ {
+ \int_const:cn { c__graphics_ #1 _pages_int }
+ {
+ \int_max:nn
+ { \int_use:N \tex_XeTeXpdfpagecount:D #1 ~ }
+ { 1 }
+ }
}
-\cs_new:Npn \__graphics_backend_include_pdf_quote:w #1 " #2 " #3 \s__graphics_stop
- { " #2 " }
%% File: l3backend-pdf.dtx
\box_new:N \l__pdf_internal_box
\cs_new_protected:Npx \__pdf_backend:n #1
@@ -884,19 +862,13 @@
{ \__pdf_backend_link_begin:n {#1#2} }
\cs_new_protected:Npx \__pdf_backend_link_begin:n #1
{
- \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- \exp_not:N \int_gincr:N \exp_not:N \g__pdf_backend_link_int
- }
+ \exp_not:N \int_gincr:N \exp_not:N \g__pdf_backend_link_int
\__pdf_backend:x
{
bann ~
- \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- @pdf.lnk
- \exp_not:N \int_use:N \exp_not:N \g__pdf_backend_link_int
- \c_space_tl
- }
+ @pdf.lnk
+ \exp_not:N \int_use:N \exp_not:N \g__pdf_backend_link_int
+ \c_space_tl
<<
/Type /Annot
#1
@@ -905,14 +877,8 @@
}
\cs_new_protected:Npn \__pdf_backend_link_end:
{ \__pdf_backend:n { eann } }
-\cs_new:Npx \__pdf_backend_link_last:
- {
- \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
- {
- @pdf.lnk
- \exp_not:N \int_use:N \exp_not:N \g__pdf_backend_link_int
- }
- }
+\cs_new:Npn \__pdf_backend_link_last:
+ { @pdf.lnk \int_use:N \g__pdf_backend_link_int }
\cs_new_protected:Npn \__pdf_backend_link_margin:n #1
{ \__kernel_backend_literal:x { dvipdfmx:config~g~ \dim_eval:n {#1} } }
\cs_new_protected:Npn \__pdf_backend_destination:nn #1#2