| 1 |
%% |
| 2 |
%% This is file `l3backend-xetex.def', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% l3backend-basics.dtx (with options: `package,xetex') |
| 8 |
%% l3backend-color.dtx (with options: `package,xetex') |
| 9 |
%% l3backend-box.dtx (with options: `package,xetex') |
| 10 |
%% l3backend-draw.dtx (with options: `package,xetex') |
| 11 |
%% l3backend-graphics.dtx (with options: `package,xetex') |
| 12 |
%% l3backend-pdf.dtx (with options: `package,xetex') |
| 13 |
%% l3backend-pdfannot.dtx (with options: `package,xetex') |
| 14 |
%% l3backend-opacity.dtx (with options: `package,xetex') |
| 15 |
%% |
| 16 |
%% Copyright (C) 2019-2026 The LaTeX Project |
| 17 |
%% |
| 18 |
%% It may be distributed and/or modified under the conditions of |
| 19 |
%% the LaTeX Project Public License (LPPL), either version 1.3c of |
| 20 |
%% this license or (at your option) any later version. The latest |
| 21 |
%% version of this license is in the file: |
| 22 |
%% |
| 23 |
%% https://www.latex-project.org/lppl.txt |
| 24 |
%% |
| 25 |
%% This file is part of the "l3backend bundle" (The Work in LPPL) |
| 26 |
%% and all files in that bundle must be distributed together. |
| 27 |
%% |
| 28 |
%% File: l3backend-basics.dtx |
| 29 |
\ProvidesExplFile |
| 30 |
{l3backend-xetex.def}{2026-02-18}{} |
| 31 |
{L3 backend support: XeTeX} |
| 32 |
\cs_if_exist:NTF \__kernel_dependency_version_check:nn |
| 33 |
{ |
| 34 |
\__kernel_dependency_version_check:nn {2023-10-10} |
| 35 |
{l3backend-xetex.def} |
| 36 |
} |
| 37 |
{ |
| 38 |
\cs_if_exist_use:cF { @latex@error } { \errmessage } |
| 39 |
{ |
| 40 |
Mismatched~LaTeX~support~files~detected. \MessageBreak |
| 41 |
Loading~aborted! |
| 42 |
} |
| 43 |
{ \use:c { @ehd } } |
| 44 |
\tex_endinput:D |
| 45 |
} |
| 46 |
\cs_new_eq:NN \__kernel_backend_literal:e \tex_special:D |
| 47 |
\cs_new_protected:Npn \__kernel_backend_literal:n #1 |
| 48 |
{ \__kernel_backend_literal:e { \exp_not:n {#1} } } |
| 49 |
\cs_if_exist:NTF \@ifl@t@r |
| 50 |
{ |
| 51 |
\@ifl@t@r \fmtversion { 2020-10-01 } |
| 52 |
{ |
| 53 |
\cs_new_protected:Npn \__kernel_backend_first_shipout:n #1 |
| 54 |
{ \hook_gput_code:nnn { shipout / firstpage } { l3backend } {#1} } |
| 55 |
} |
| 56 |
{ \cs_new_eq:NN \__kernel_backend_first_shipout:n \AtBeginDvi } |
| 57 |
} |
| 58 |
{ \cs_new_eq:NN \__kernel_backend_first_shipout:n \use:n } |
| 59 |
\cs_new_protected:Npn \__kernel_backend_literal_pdf:n #1 |
| 60 |
{ \__kernel_backend_literal:n { pdf:literal~ #1 } } |
| 61 |
\cs_generate_variant:Nn \__kernel_backend_literal_pdf:n { e } |
| 62 |
\cs_new_protected:Npn \__kernel_backend_literal_page:n #1 |
| 63 |
{ \__kernel_backend_literal:n { pdf:literal~direct~ #1 } } |
| 64 |
\cs_new_protected:Npn \__kernel_backend_scope_begin: |
| 65 |
{ \__kernel_backend_literal:n { x:gsave } } |
| 66 |
\cs_new_protected:Npn \__kernel_backend_scope_end: |
| 67 |
{ \__kernel_backend_literal:n { x:grestore } } |
| 68 |
%% File: l3backend-color.dtx |
| 69 |
\cs_new_protected:Npn \__color_backend_select:n #1 |
| 70 |
{ \__kernel_backend_literal:n { pdf : bc ~ [ #1 ] } } |
| 71 |
\cs_new_eq:NN \__color_backend_select_cmyk:n \__color_backend_select:n |
| 72 |
\cs_new_eq:NN \__color_backend_select_gray:n \__color_backend_select:n |
| 73 |
\cs_new_eq:NN \__color_backend_select_rgb:n \__color_backend_select:n |
| 74 |
\cs_new_protected:Npn \__color_backend_reset: |
| 75 |
{ \__kernel_backend_literal:n { pdf : ec } } |
| 76 |
\cs_new_protected:Npn \__color_backend_select_named:n #1 |
| 77 |
{ |
| 78 |
\str_if_eq:nnTF {#1} { Black } |
| 79 |
{ \__color_backend_select_gray:n { 0 } } |
| 80 |
{ \msg_error:nnn { color } { unknown-named-color } {#1} } |
| 81 |
} |
| 82 |
\msg_new:nnn { color } { unknown-named-color } |
| 83 |
{ Named~color~'#1'~is~not~known. } |
| 84 |
\prop_new:N \g__color_backend_colorant_prop |
| 85 |
\cs_new:Npe \__color_backend_devicen_colorants:n #1 |
| 86 |
{ |
| 87 |
\exp_not:N \tl_if_blank:nF {#1} |
| 88 |
{ |
| 89 |
\c_space_tl |
| 90 |
<< ~ |
| 91 |
/Colorants ~ |
| 92 |
<< ~ |
| 93 |
\exp_not:N \__color_backend_devicen_colorants:w #1 ~ |
| 94 |
\exp_not:N \q_recursion_tail \c_space_tl |
| 95 |
\exp_not:N \q_recursion_stop |
| 96 |
>> ~ |
| 97 |
>> |
| 98 |
} |
| 99 |
} |
| 100 |
\cs_new:Npn \__color_backend_devicen_colorants:w #1 ~ |
| 101 |
{ |
| 102 |
\quark_if_recursion_tail_stop:n {#1} |
| 103 |
\prop_if_in:NnT \g__color_backend_colorant_prop {#1} |
| 104 |
{ |
| 105 |
#1 ~ |
| 106 |
\prop_item:Nn \g__color_backend_colorant_prop {#1} ~ |
| 107 |
} |
| 108 |
\__color_backend_devicen_colorants:w |
| 109 |
} |
| 110 |
\cs_new_protected:Npn \__color_backend_select_separation:nn #1#2 |
| 111 |
{ \__kernel_backend_literal:e { pdf : bc ~ \pdf_object_ref:n {#1} ~ [ #2 ] } } |
| 112 |
\cs_new_eq:NN \__color_backend_select_devicen:nn \__color_backend_select_separation:nn |
| 113 |
\cs_new_eq:NN \__color_backend_select_iccbased:nn \__color_backend_select_separation:nn |
| 114 |
\cs_new_protected:Npn \__color_backend_init_resource:n #1 |
| 115 |
{ |
| 116 |
} |
| 117 |
\cs_new_protected:Npn \__color_backend_separation_init:nnnnn #1#2#3#4#5 |
| 118 |
{ |
| 119 |
\pdf_object_unnamed_write:ne { dict } |
| 120 |
{ |
| 121 |
/FunctionType ~ 2 |
| 122 |
/Domain ~ [0 ~ 1] |
| 123 |
\tl_if_blank:nF {#3} { /Range ~ [#3] } |
| 124 |
/C0 ~ [#4] ~ |
| 125 |
/C1 ~ [#5] /N ~ 1 |
| 126 |
} |
| 127 |
\exp_args:Ne \__color_backend_separation_init:nn |
| 128 |
{ \str_convert_pdfname:n {#1} } {#2} |
| 129 |
\__color_backend_init_resource:n { color \int_use:N \g__color_model_int } |
| 130 |
} |
| 131 |
\cs_new_protected:Npn \__color_backend_separation_init:nn #1#2 |
| 132 |
{ |
| 133 |
\use:e |
| 134 |
{ |
| 135 |
\pdf_object_new:n { color \int_use:N \g__color_model_int } |
| 136 |
\pdf_object_write:nnn { color \int_use:N \g__color_model_int } { array } |
| 137 |
{ /Separation /#1 ~ #2 ~ \pdf_object_ref_last: } |
| 138 |
} |
| 139 |
\prop_gput:Nne \g__color_backend_colorant_prop { /#1 } |
| 140 |
{ \pdf_object_ref_last: } |
| 141 |
} |
| 142 |
\cs_new_protected:Npn \__color_backend_separation_init_CIELAB:nnn #1#2#3 |
| 143 |
{ |
| 144 |
\pdf_object_if_exist:nF { __color_illuminant_CIELAB_ #1 } |
| 145 |
{ |
| 146 |
\pdf_object_new:n { __color_illuminant_CIELAB_ #1 } |
| 147 |
\pdf_object_write:nne { __color_illuminant_CIELAB_ #1 } { array } |
| 148 |
{ |
| 149 |
/Lab ~ |
| 150 |
<< |
| 151 |
/WhitePoint ~ |
| 152 |
[ \tl_use:c { c__color_model_whitepoint_CIELAB_ #1 _tl } ] |
| 153 |
/Range ~ [ \c__color_model_range_CIELAB_tl ] |
| 154 |
>> |
| 155 |
} |
| 156 |
} |
| 157 |
\__color_backend_separation_init:nnnnn |
| 158 |
{#2} |
| 159 |
{ \pdf_object_ref:n { __color_illuminant_CIELAB_ #1 } } |
| 160 |
{ \c__color_model_range_CIELAB_tl } |
| 161 |
{ 100 ~ 0 ~ 0 } |
| 162 |
{#3} |
| 163 |
} |
| 164 |
\cs_new_protected:Npn \__color_backend_devicen_init:nnn #1#2#3 |
| 165 |
{ |
| 166 |
\pdf_object_unnamed_write:ne { stream } |
| 167 |
{ |
| 168 |
{ |
| 169 |
/FunctionType ~ 4 ~ |
| 170 |
/Domain ~ |
| 171 |
[ ~ |
| 172 |
\prg_replicate:nn |
| 173 |
{ 0 \__color_backend_devicen_init:w #1 ~ \s__color_stop } |
| 174 |
{ 0 ~ 1 ~ } |
| 175 |
] ~ |
| 176 |
/Range ~ |
| 177 |
[ ~ |
| 178 |
\str_case:nn {#2} |
| 179 |
{ |
| 180 |
{ /DeviceCMYK } { 0 ~ 1 ~ 0 ~ 1 ~ 0 ~ 1 ~ 0 ~ 1 } |
| 181 |
{ /DeviceGray } { 0 ~ 1 } |
| 182 |
{ /DeviceRGB } { 0 ~ 1 ~ 0 ~ 1 ~ 0 ~ 1 } |
| 183 |
} ~ |
| 184 |
] |
| 185 |
} |
| 186 |
{ {#3} } |
| 187 |
} |
| 188 |
\use:e |
| 189 |
{ |
| 190 |
\pdf_object_new:n { color \int_use:N \g__color_model_int } |
| 191 |
\pdf_object_write:nnn { color \int_use:N \g__color_model_int } { array } |
| 192 |
{ |
| 193 |
/DeviceN ~ |
| 194 |
[ ~ #1 ~ ] ~ |
| 195 |
#2 ~ |
| 196 |
\pdf_object_ref_last: |
| 197 |
\__color_backend_devicen_colorants:n {#1} |
| 198 |
} |
| 199 |
} |
| 200 |
\__color_backend_init_resource:n { color \int_use:N \g__color_model_int } |
| 201 |
} |
| 202 |
\cs_new:Npn \__color_backend_devicen_init:w #1 ~ #2 \s__color_stop |
| 203 |
{ |
| 204 |
+ 1 |
| 205 |
\tl_if_blank:nF {#2} |
| 206 |
{ \__color_backend_devicen_init:w #2 \s__color_stop } |
| 207 |
} |
| 208 |
\cs_new_protected:Npn \__color_backend_iccbased_init:nnn #1#2#3 |
| 209 |
{ |
| 210 |
\pdf_object_if_exist:nF { __color_icc_ #1 } |
| 211 |
{ |
| 212 |
\pdf_object_new:n { __color_icc_ #1 } |
| 213 |
\pdf_object_write:nne { __color_icc_ #1 } { fstream } |
| 214 |
{ |
| 215 |
{ |
| 216 |
/N ~ \exp_not:n { #2 } ~ |
| 217 |
\tl_if_empty:nF { #3 } { /Range~[ #3 ] } |
| 218 |
} |
| 219 |
{#1} |
| 220 |
} |
| 221 |
} |
| 222 |
\pdf_object_unnamed_write:ne { array } |
| 223 |
{ /ICCBased ~ \pdf_object_ref:n { __color_icc_ #1 } } |
| 224 |
\__color_backend_init_resource:n { color \int_use:N \g__color_model_int } |
| 225 |
} |
| 226 |
\cs_new_protected:Npn \__color_backend_iccbased_device:nnn #1#2#3 |
| 227 |
{ |
| 228 |
\pdf_object_if_exist:nF { __color_icc_ #1 } |
| 229 |
{ |
| 230 |
\pdf_object_new:n { __color_icc_ #1 } |
| 231 |
\pdf_object_write:nnn { __color_icc_ #1 } { fstream } |
| 232 |
{ |
| 233 |
{ /N ~ #3 } |
| 234 |
{#1} |
| 235 |
} |
| 236 |
} |
| 237 |
\pdf_object_unnamed_write:ne { array } |
| 238 |
{ /ICCBased ~ \pdf_object_ref:n { __color_icc_ #1 } } |
| 239 |
\__color_backend_init_resource:n { Default #2 } |
| 240 |
} |
| 241 |
\cs_new_protected:Npn \__color_backend_fill:n #1 |
| 242 |
{ \__kernel_backend_literal:n { pdf : bc ~ fill ~ [ #1 ] } } |
| 243 |
\cs_new_eq:NN \__color_backend_fill_cmyk:n \__color_backend_fill:n |
| 244 |
\cs_new_eq:NN \__color_backend_fill_gray:n \__color_backend_fill:n |
| 245 |
\cs_new_eq:NN \__color_backend_fill_rgb:n \__color_backend_fill:n |
| 246 |
\cs_new_protected:Npn \__color_backend_stroke:n #1 |
| 247 |
{ \__kernel_backend_literal:n { pdf : bc ~ stroke ~ [ #1 ] } } |
| 248 |
\cs_new_eq:NN \__color_backend_stroke_cmyk:n \__color_backend_stroke:n |
| 249 |
\cs_new_eq:NN \__color_backend_stroke_gray:n \__color_backend_stroke:n |
| 250 |
\cs_new_eq:NN \__color_backend_stroke_rgb:n \__color_backend_stroke:n |
| 251 |
\cs_new_protected:Npn \__color_backend_fill_separation:nn #1#2 |
| 252 |
{ |
| 253 |
\__kernel_backend_literal:e |
| 254 |
{ pdf : bc ~ fill ~ \pdf_object_ref:n {#1} ~ [ #2 ] } |
| 255 |
} |
| 256 |
\cs_new_protected:Npn \__color_backend_stroke_separation:nn #1#2 |
| 257 |
{ |
| 258 |
\__kernel_backend_literal:e |
| 259 |
{ pdf : bc ~ stroke ~ \pdf_object_ref:n {#1} ~ [ #2 ] } |
| 260 |
} |
| 261 |
\cs_new_eq:NN \__color_backend_fill_devicen:nn \__color_backend_fill_separation:nn |
| 262 |
\cs_new_eq:NN \__color_backend_stroke_devicen:nn \__color_backend_stroke_separation:nn |
| 263 |
\cs_new_eq:NN \__color_backend_fill_reset: \__color_backend_reset: |
| 264 |
\cs_new_eq:NN \__color_backend_stroke_reset: \__color_backend_reset: |
| 265 |
%% File: l3backend-box.dtx |
| 266 |
\cs_new_protected:Npn \__box_backend_clip:N #1 |
| 267 |
{ |
| 268 |
\__kernel_backend_scope_begin: |
| 269 |
\__kernel_backend_literal_pdf:e |
| 270 |
{ |
| 271 |
0~ |
| 272 |
\dim_to_decimal_in_bp:n { -\box_dp:N #1 } ~ |
| 273 |
\dim_to_decimal_in_bp:n { \box_wd:N #1 } ~ |
| 274 |
\dim_to_decimal_in_bp:n { \box_ht:N #1 + \box_dp:N #1 } ~ |
| 275 |
re~W~n |
| 276 |
} |
| 277 |
\hbox_overlap_right:n { \box_use:N #1 } |
| 278 |
\__kernel_backend_scope_end: |
| 279 |
\skip_horizontal:n { \box_wd:N #1 } |
| 280 |
} |
| 281 |
\cs_new_protected:Npn \__box_backend_rotate:Nn #1#2 |
| 282 |
{ \exp_args:NNf \__box_backend_rotate_aux:Nn #1 { \fp_eval:n {#2} } } |
| 283 |
\cs_new_protected:Npn \__box_backend_rotate_aux:Nn #1#2 |
| 284 |
{ |
| 285 |
\__kernel_backend_scope_begin: |
| 286 |
\__kernel_backend_literal:e |
| 287 |
{ |
| 288 |
x:rotate~ |
| 289 |
\fp_compare:nNnTF {#2} = \c_zero_fp |
| 290 |
{ 0 } |
| 291 |
{ \fp_eval:n { round ( #2 , 5 ) } } |
| 292 |
} |
| 293 |
\box_use:N #1 |
| 294 |
\__kernel_backend_scope_end: |
| 295 |
} |
| 296 |
\cs_new_protected:Npn \__box_backend_scale:Nnn #1#2#3 |
| 297 |
{ |
| 298 |
\__kernel_backend_scope_begin: |
| 299 |
\__kernel_backend_literal:e |
| 300 |
{ |
| 301 |
x:scale~ |
| 302 |
\fp_eval:n { round ( #2 , 5 ) } ~ |
| 303 |
\fp_eval:n { round ( #3 , 5 ) } |
| 304 |
} |
| 305 |
\hbox_overlap_right:n { \box_use:N #1 } |
| 306 |
\__kernel_backend_scope_end: |
| 307 |
} |
| 308 |
%% File: l3backend-draw.dtx |
| 309 |
\cs_new_eq:NN \__draw_backend_literal:n \__kernel_backend_literal_pdf:n |
| 310 |
\cs_new_eq:NN \__draw_backend_literal:e \__kernel_backend_literal_pdf:e |
| 311 |
\cs_new_protected:Npn \__draw_backend_begin: |
| 312 |
{ \__draw_backend_scope_begin: } |
| 313 |
\cs_new_protected:Npn \__draw_backend_end: |
| 314 |
{ \__draw_backend_scope_end: } |
| 315 |
\cs_new_eq:NN \__draw_backend_scope_begin: \__kernel_backend_scope_begin: |
| 316 |
\cs_new_eq:NN \__draw_backend_scope_end: \__kernel_backend_scope_end: |
| 317 |
\cs_new_protected:Npn \__draw_backend_moveto:nn #1#2 |
| 318 |
{ |
| 319 |
\__draw_backend_literal:e |
| 320 |
{ \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ m } |
| 321 |
} |
| 322 |
\cs_new_protected:Npn \__draw_backend_lineto:nn #1#2 |
| 323 |
{ |
| 324 |
\__draw_backend_literal:e |
| 325 |
{ \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ l } |
| 326 |
} |
| 327 |
\cs_new_protected:Npn \__draw_backend_curveto:nnnnnn #1#2#3#4#5#6 |
| 328 |
{ |
| 329 |
\__draw_backend_literal:e |
| 330 |
{ |
| 331 |
\dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ |
| 332 |
\dim_to_decimal_in_bp:n {#3} ~ \dim_to_decimal_in_bp:n {#4} ~ |
| 333 |
\dim_to_decimal_in_bp:n {#5} ~ \dim_to_decimal_in_bp:n {#6} ~ |
| 334 |
c |
| 335 |
} |
| 336 |
} |
| 337 |
\cs_new_protected:Npn \__draw_backend_rectangle:nnnn #1#2#3#4 |
| 338 |
{ |
| 339 |
\__draw_backend_literal:e |
| 340 |
{ |
| 341 |
\dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ |
| 342 |
\dim_to_decimal_in_bp:n {#3} ~ \dim_to_decimal_in_bp:n {#4} ~ |
| 343 |
re |
| 344 |
} |
| 345 |
} |
| 346 |
\cs_new_protected:Npn \__draw_backend_evenodd_rule: |
| 347 |
{ \bool_gset_true:N \g__draw_draw_eor_bool } |
| 348 |
\cs_new_protected:Npn \__draw_backend_nonzero_rule: |
| 349 |
{ \bool_gset_false:N \g__draw_draw_eor_bool } |
| 350 |
\bool_new:N \g__draw_draw_eor_bool |
| 351 |
\cs_new_protected:Npn \__draw_backend_closepath: |
| 352 |
{ \__draw_backend_literal:n { h } } |
| 353 |
\cs_new_protected:Npn \__draw_backend_stroke: |
| 354 |
{ \__draw_backend_literal:n { S } } |
| 355 |
\cs_new_protected:Npn \__draw_backend_closestroke: |
| 356 |
{ \__draw_backend_literal:n { s } } |
| 357 |
\cs_new_protected:Npn \__draw_backend_fill: |
| 358 |
{ |
| 359 |
\__draw_backend_literal:e |
| 360 |
{ f \bool_if:NT \g__draw_draw_eor_bool * } |
| 361 |
} |
| 362 |
\cs_new_protected:Npn \__draw_backend_fillstroke: |
| 363 |
{ |
| 364 |
\__draw_backend_literal:e |
| 365 |
{ B \bool_if:NT \g__draw_draw_eor_bool * } |
| 366 |
} |
| 367 |
\cs_new_protected:Npn \__draw_backend_clip: |
| 368 |
{ |
| 369 |
\__draw_backend_literal:e |
| 370 |
{ W \bool_if:NT \g__draw_draw_eor_bool * } |
| 371 |
} |
| 372 |
\cs_new_protected:Npn \__draw_backend_discardpath: |
| 373 |
{ \__draw_backend_literal:n { n } } |
| 374 |
\cs_new_protected:Npn \__draw_backend_dash_pattern:nn #1#2 |
| 375 |
{ |
| 376 |
\__draw_backend_literal:e |
| 377 |
{ |
| 378 |
[ |
| 379 |
\exp_args:Nf \use:n |
| 380 |
{ \clist_map_function:nN {#1} \__draw_backend_dash:n } |
| 381 |
] ~ |
| 382 |
\dim_to_decimal_in_bp:n {#2} ~ d |
| 383 |
} |
| 384 |
} |
| 385 |
\cs_new:Npn \__draw_backend_dash:n #1 |
| 386 |
{ ~ \dim_to_decimal_in_bp:n {#1} } |
| 387 |
\cs_new_protected:Npn \__draw_backend_linewidth:n #1 |
| 388 |
{ |
| 389 |
\__draw_backend_literal:e |
| 390 |
{ \dim_to_decimal_in_bp:n {#1} ~ w } |
| 391 |
} |
| 392 |
\cs_new_protected:Npn \__draw_backend_miterlimit:n #1 |
| 393 |
{ \__draw_backend_literal:e { #1 ~ M } } |
| 394 |
\cs_new_protected:Npn \__draw_backend_cap_butt: |
| 395 |
{ \__draw_backend_literal:n { 0 ~ J } } |
| 396 |
\cs_new_protected:Npn \__draw_backend_cap_round: |
| 397 |
{ \__draw_backend_literal:n { 1 ~ J } } |
| 398 |
\cs_new_protected:Npn \__draw_backend_cap_rectangle: |
| 399 |
{ \__draw_backend_literal:n { 2 ~ J } } |
| 400 |
\cs_new_protected:Npn \__draw_backend_join_miter: |
| 401 |
{ \__draw_backend_literal:n { 0 ~ j } } |
| 402 |
\cs_new_protected:Npn \__draw_backend_join_round: |
| 403 |
{ \__draw_backend_literal:n { 1 ~ j } } |
| 404 |
\cs_new_protected:Npn \__draw_backend_join_bevel: |
| 405 |
{ \__draw_backend_literal:n { 2 ~ j } } |
| 406 |
\cs_new_protected:Npn \__draw_backend_transform:nnnn #1#2#3#4 |
| 407 |
{ |
| 408 |
\str_if_eq:nnTF { #2 ~ #3 } { 0 ~ 0 } |
| 409 |
{ |
| 410 |
\__kernel_backend_literal:n { x:rotate~0 } |
| 411 |
\__kernel_backend_literal:n { x:scale~#1~#4 } |
| 412 |
\__kernel_backend_literal:n { x:rotate~0 } |
| 413 |
} |
| 414 |
{ |
| 415 |
\__draw_backend_transform_decompose:nnnnN {#1} {#2} {#3} {#4} |
| 416 |
\__draw_backend_transform_aux:nnnn |
| 417 |
} |
| 418 |
} |
| 419 |
\cs_new_protected:Npn \__draw_backend_transform_aux:nnnn #1#2#3#4 |
| 420 |
{ |
| 421 |
\__kernel_backend_literal:e |
| 422 |
{ |
| 423 |
x:rotate~ |
| 424 |
\fp_compare:nNnTF {#1} = \c_zero_fp |
| 425 |
{ 0 } |
| 426 |
{ \fp_eval:n { round ( -#1 , 5 ) } } |
| 427 |
} |
| 428 |
\__kernel_backend_literal:e |
| 429 |
{ |
| 430 |
x:scale~ |
| 431 |
\fp_eval:n { round ( #2 , 5 ) } ~ |
| 432 |
\fp_eval:n { round ( #3 , 5 ) } |
| 433 |
} |
| 434 |
\__kernel_backend_literal:e |
| 435 |
{ |
| 436 |
x:rotate~ |
| 437 |
\fp_compare:nNnTF {#4} = \c_zero_fp |
| 438 |
{ 0 } |
| 439 |
{ \fp_eval:n { round ( -#4 , 5 ) } } |
| 440 |
} |
| 441 |
} |
| 442 |
\cs_new_protected:Npn \__draw_backend_shift:nn #1#2 |
| 443 |
{ |
| 444 |
\__draw_backend_literal:n |
| 445 |
{ 1 ~ 0 ~ 0 ~ 1 ~ #1 ~ #2 ~ cm } |
| 446 |
} |
| 447 |
\cs_new_protected:Npn \__draw_backend_transform_decompose:nnnnN #1#2#3#4#5 |
| 448 |
{ |
| 449 |
\use:e |
| 450 |
{ |
| 451 |
\__draw_backend_transform_decompose_auxi:nnnnN |
| 452 |
{ \fp_eval:n { (#1 + #4) / 2 } } |
| 453 |
{ \fp_eval:n { (#1 - #4) / 2 } } |
| 454 |
{ \fp_eval:n { (#3 + #2) / 2 } } |
| 455 |
{ \fp_eval:n { (#3 - #2) / 2 } } |
| 456 |
} |
| 457 |
#5 |
| 458 |
} |
| 459 |
\cs_new_protected:Npn \__draw_backend_transform_decompose_auxi:nnnnN #1#2#3#4#5 |
| 460 |
{ |
| 461 |
\use:e |
| 462 |
{ |
| 463 |
\__draw_backend_transform_decompose_auxii:nnnnN |
| 464 |
{ \fp_eval:n { 2 * sqrt ( #1 * #1 + #4 * #4 ) } } |
| 465 |
{ \fp_eval:n { 2 * sqrt ( #2 * #2 + #3 * #3 ) } } |
| 466 |
{ \fp_eval:n { atand ( #3 , #2 ) } } |
| 467 |
{ \fp_eval:n { atand ( #4 , #1 ) } } |
| 468 |
} |
| 469 |
#5 |
| 470 |
} |
| 471 |
\cs_new_protected:Npn \__draw_backend_transform_decompose_auxii:nnnnN #1#2#3#4#5 |
| 472 |
{ |
| 473 |
\use:e |
| 474 |
{ |
| 475 |
\__draw_backend_transform_decompose_auxiii:nnnnN |
| 476 |
{ \fp_eval:n { ( #4 - #3 ) / 2 } } |
| 477 |
{ \fp_eval:n { ( #1 + #2 ) / 2 } } |
| 478 |
{ \fp_eval:n { ( #1 - #2 ) / 2 } } |
| 479 |
{ \fp_eval:n { ( #4 + #3 ) / 2 } } |
| 480 |
} |
| 481 |
#5 |
| 482 |
} |
| 483 |
\cs_new_protected:Npn \__draw_backend_transform_decompose_auxiii:nnnnN #1#2#3#4#5 |
| 484 |
{ |
| 485 |
\fp_compare:nNnTF { abs( #2 ) } > { abs ( #3 ) } |
| 486 |
{ #5 {#1} {#2} {#3} {#4} } |
| 487 |
{ #5 {#1} {#3} {#2} {#4} } |
| 488 |
} |
| 489 |
\cs_new_protected:Npn \__draw_backend_box_use:Nnnnn #1#2#3#4#5 |
| 490 |
{ |
| 491 |
\__kernel_backend_scope_begin: |
| 492 |
\__kernel_backend_literal:n |
| 493 |
{ pdf:btrans~matrix~ #2 ~ #3 ~ #4 ~ #5 ~ 0 ~ 0 } |
| 494 |
\hbox_overlap_right:n { \box_use:N #1 } |
| 495 |
\__kernel_backend_literal:n { pdf:etrans } |
| 496 |
\__kernel_backend_scope_end: |
| 497 |
} |
| 498 |
%% File: l3backend-graphics.dtx |
| 499 |
\seq_set_from_clist:Nn \l_graphics_search_ext_seq |
| 500 |
{ .pdf , .eps , .ps , .png , .jpg , .jpeg , .bmp } |
| 501 |
\cs_new_eq:NN \__graphics_backend_getbb_eps:n \__graphics_read_bb:n |
| 502 |
\cs_new_eq:NN \__graphics_backend_getbb_ps:n \__graphics_read_bb:n |
| 503 |
\bool_new:N \l__graphics_transgroup_bool |
| 504 |
\int_new:N \g__graphics_track_int |
| 505 |
\cs_new_protected:Npn \__graphics_backend_include_eps:n #1 |
| 506 |
{ |
| 507 |
\__kernel_backend_literal:e |
| 508 |
{ |
| 509 |
PSfile = #1 \c_space_tl |
| 510 |
llx = \dim_to_decimal_in_bp:n \l__graphics_llx_dim \c_space_tl |
| 511 |
lly = \dim_to_decimal_in_bp:n \l__graphics_lly_dim \c_space_tl |
| 512 |
urx = \dim_to_decimal_in_bp:n \l__graphics_urx_dim \c_space_tl |
| 513 |
ury = \dim_to_decimal_in_bp:n \l__graphics_ury_dim |
| 514 |
} |
| 515 |
} |
| 516 |
\cs_new_eq:NN \__graphics_backend_include_ps:n \__graphics_backend_include_eps:n |
| 517 |
\cs_new_protected:Npn \__graphics_backend_include_jpg:n #1 |
| 518 |
{ |
| 519 |
\bool_set_false:N \l__graphics_transgroup_bool |
| 520 |
\__graphics_backend_include_auxi:n {#1} |
| 521 |
} |
| 522 |
\cs_new_eq:NN \__graphics_backend_include_jpeg:n \__graphics_backend_include_jpg:n |
| 523 |
\cs_new_eq:NN \__graphics_backend_include_bmp:n \__graphics_backend_include_jpg:n |
| 524 |
\cs_new_eq:NN \__graphics_backend_include_png:n \__graphics_backend_include_jpg:n |
| 525 |
\cs_new_protected:Npn \__graphics_backend_include_pdf:n #1 |
| 526 |
{ |
| 527 |
\bool_set_true:N \l__graphics_transgroup_bool |
| 528 |
\__graphics_backend_include_auxi:n {#1} |
| 529 |
} |
| 530 |
\cs_new_protected:Npn \__graphics_backend_include_auxi:n #1 |
| 531 |
{ |
| 532 |
\__graphics_backend_include_auxii:en |
| 533 |
{ |
| 534 |
\tl_if_empty:NF \l__graphics_pagebox_tl |
| 535 |
{ : \l__graphics_pagebox_tl } |
| 536 |
\int_compare:nNnT \l__graphics_page_int > 1 |
| 537 |
{ :P \int_use:N \l__graphics_page_int } |
| 538 |
\tl_if_empty:NF \l__graphics_decodearray_str |
| 539 |
{ :D \l__graphics_decodearray_str } |
| 540 |
\bool_if:NT \l__graphics_interpolate_bool |
| 541 |
{ :I } |
| 542 |
} |
| 543 |
{#1} |
| 544 |
} |
| 545 |
\cs_new_protected:Npn \__graphics_backend_include_auxii:nn #1#2 |
| 546 |
{ |
| 547 |
\int_if_exist:cTF { c__graphics_ #2#1 _int } |
| 548 |
{ |
| 549 |
\__kernel_backend_literal:e |
| 550 |
{ pdf:usexobj~@graphic \int_use:c { c__graphics_ #2#1 _int } } |
| 551 |
} |
| 552 |
{ \__graphics_backend_include_auxiii:nn {#2} {#1} } |
| 553 |
} |
| 554 |
\cs_generate_variant:Nn \__graphics_backend_include_auxii:nn { e } |
| 555 |
\cs_new_protected:Npn \__graphics_backend_include_auxiii:nn #1#2 |
| 556 |
{ |
| 557 |
\int_gincr:N \g__graphics_track_int |
| 558 |
\int_const:cn { c__graphics_ #1#2 _int } { \g__graphics_track_int } |
| 559 |
\__kernel_backend_literal:e |
| 560 |
{ |
| 561 |
pdf:image ~ |
| 562 |
@graphic \int_use:c { c__graphics_ #1#2 _int } ~ |
| 563 |
\int_compare:nNnT \l__graphics_page_int > 1 |
| 564 |
{ page ~ \int_use:N \l__graphics_page_int \c_space_tl } |
| 565 |
\tl_if_empty:NF \l__graphics_pagebox_tl |
| 566 |
{ |
| 567 |
pagebox ~ \l__graphics_pagebox_tl \c_space_tl |
| 568 |
bbox ~ |
| 569 |
\dim_to_decimal_in_bp:n \l__graphics_llx_dim \c_space_tl |
| 570 |
\dim_to_decimal_in_bp:n \l__graphics_lly_dim \c_space_tl |
| 571 |
\dim_to_decimal_in_bp:n \l__graphics_urx_dim \c_space_tl |
| 572 |
\dim_to_decimal_in_bp:n \l__graphics_ury_dim \c_space_tl |
| 573 |
} |
| 574 |
(#1) |
| 575 |
\bool_lazy_any:nT |
| 576 |
{ |
| 577 |
{ \l__graphics_interpolate_bool } |
| 578 |
{ \l__graphics_transgroup_bool } |
| 579 |
{ ! \tl_if_empty_p:N \l__graphics_decodearray_str } |
| 580 |
} |
| 581 |
{ |
| 582 |
<< |
| 583 |
\tl_if_empty:NF \l__graphics_decodearray_str |
| 584 |
{ /Decode~[ \l__graphics_decodearray_str ] } |
| 585 |
\bool_if:NT \l__graphics_transgroup_bool |
| 586 |
{ /Group << /S /Transparency /K ~ false /I ~ false >> } |
| 587 |
\bool_if:NT \l__graphics_interpolate_bool |
| 588 |
{ /Interpolate~true } |
| 589 |
>> |
| 590 |
} |
| 591 |
} |
| 592 |
} |
| 593 |
\cs_new_protected:Npn \__graphics_backend_getbb_jpg:n #1 |
| 594 |
{ |
| 595 |
\int_zero:N \l__graphics_page_int |
| 596 |
\tl_clear:N \l__graphics_pagebox_tl |
| 597 |
\__graphics_backend_getbb_auxi:nN {#1} \tex_XeTeXpicfile:D |
| 598 |
} |
| 599 |
\cs_new_eq:NN \__graphics_backend_getbb_jpeg:n \__graphics_backend_getbb_jpg:n |
| 600 |
\cs_new_eq:NN \__graphics_backend_getbb_png:n \__graphics_backend_getbb_jpg:n |
| 601 |
\cs_new_eq:NN \__graphics_backend_getbb_bmp:n \__graphics_backend_getbb_jpg:n |
| 602 |
\cs_new_protected:Npn \__graphics_backend_getbb_pdf:n #1 |
| 603 |
{ |
| 604 |
\tl_clear:N \l__graphics_decodearray_str |
| 605 |
\bool_set_false:N \l__graphics_interpolate_bool |
| 606 |
\__graphics_backend_getbb_auxi:nN {#1} \tex_XeTeXpdffile:D |
| 607 |
} |
| 608 |
\cs_new_protected:Npn \__graphics_backend_getbb_auxi:nN #1#2 |
| 609 |
{ |
| 610 |
\int_compare:nNnTF \l__graphics_page_int > 1 |
| 611 |
{ \__graphics_backend_getbb_auxii:VnN \l__graphics_page_int {#1} #2 } |
| 612 |
{ \__graphics_backend_getbb_auxiii:nNnn {#1} #2 { :P 1 } { page 1 } } |
| 613 |
} |
| 614 |
\cs_new_protected:Npn \__graphics_backend_getbb_auxii:nnN #1#2#3 |
| 615 |
{ \__graphics_backend_getbb_auxiii:nNnn {#2} #3 { :P #1 } { page #1 } } |
| 616 |
\cs_generate_variant:Nn \__graphics_backend_getbb_auxii:nnN { V } |
| 617 |
\cs_new_protected:Npn \__graphics_backend_getbb_auxiii:nNnn #1#2#3#4 |
| 618 |
{ |
| 619 |
\tl_if_empty:NTF \l__graphics_pagebox_tl |
| 620 |
{ \__graphics_backend_getbb_auxiv:VnNnn \l__graphics_pagebox_tl } |
| 621 |
{ \__graphics_backend_getbb_auxv:nNnn } |
| 622 |
{#1} #2 {#3} {#4} |
| 623 |
} |
| 624 |
\cs_new_protected:Npn \__graphics_backend_getbb_auxiv:nnNnn #1#2#3#4#5 |
| 625 |
{ |
| 626 |
\use:e |
| 627 |
{ |
| 628 |
\__graphics_backend_getbb_auxv:nNnn {#2} #3 { : #1 #4 } |
| 629 |
{ |
| 630 |
#5 |
| 631 |
\tl_if_blank:nF {#1} |
| 632 |
{ \c_space_tl \__graphics_backend_getbb_pagebox:w #1 } |
| 633 |
} |
| 634 |
} |
| 635 |
} |
| 636 |
\cs_generate_variant:Nn \__graphics_backend_getbb_auxiv:nnNnn { V } |
| 637 |
\cs_new_protected:Npn \__graphics_backend_getbb_auxv:nNnn #1#2#3#4 |
| 638 |
{ |
| 639 |
\__graphics_bb_restore:nF {#1#3} |
| 640 |
{ \__graphics_backend_getbb_auxvi:nNnn {#1} #2 {#3} {#4} } |
| 641 |
} |
| 642 |
\cs_new_protected:Npn \__graphics_backend_getbb_auxvi:nNnn #1#2#3#4 |
| 643 |
{ |
| 644 |
\hbox_set:Nn \l__graphics_tmp_box { #2 #1 ~ #4 } |
| 645 |
\dim_set:Nn \l__graphics_urx_dim { \box_wd:N \l__graphics_tmp_box } |
| 646 |
\dim_set:Nn \l__graphics_ury_dim { \box_ht:N \l__graphics_tmp_box } |
| 647 |
\__graphics_bb_save:n {#1#3} |
| 648 |
} |
| 649 |
\cs_new:Npn \__graphics_backend_getbb_pagebox:w #1 box {#1} |
| 650 |
\cs_new_protected:Npn \__graphics_backend_get_pagecount:n #1 |
| 651 |
{ |
| 652 |
\int_const:cn { c__graphics_ #1 _pages_int } |
| 653 |
{ |
| 654 |
\int_max:nn |
| 655 |
{ \int_use:N \tex_XeTeXpdfpagecount:D #1 ~ } |
| 656 |
{ 1 } |
| 657 |
} |
| 658 |
} |
| 659 |
%% File: l3backend-pdf.dtx |
| 660 |
\cs_new_protected:Npe \__pdf_backend:n #1 |
| 661 |
{ \__kernel_backend_literal:n { pdf: #1 } } |
| 662 |
\cs_generate_variant:Nn \__pdf_backend:n { e } |
| 663 |
\cs_new_protected:Npn \__pdf_backend_catalog_gput:nn #1#2 |
| 664 |
{ \__pdf_backend:n { put ~ @catalog << /#1 ~ #2 >> } } |
| 665 |
\cs_new_protected:Npn \__pdf_backend_info_gput:nn #1#2 |
| 666 |
{ \__pdf_backend:n { docinfo << /#1 ~ #2 >> } } |
| 667 |
\prop_new:N \g__pdf_backend_object_prop |
| 668 |
\cs_new_protected:Npn \__pdf_backend_object_new: |
| 669 |
{ \int_gincr:N \g__pdf_backend_object_int } |
| 670 |
\cs_new:Npn \__pdf_backend_object_ref:n #1 { @pdf.obj #1 } |
| 671 |
\cs_new_eq:NN \__pdf_backend_object_id:n \__pdf_backend_object_ref:n |
| 672 |
\cs_new_protected:Npn \__pdf_backend_object_write:nnn #1#2#3 |
| 673 |
{ |
| 674 |
\use:c { __pdf_backend_object_write_ #2 :nn } |
| 675 |
{ \__pdf_backend_object_ref:n {#1} } {#3} |
| 676 |
} |
| 677 |
\cs_generate_variant:Nn \__pdf_backend_object_write:nnn { nne } |
| 678 |
\cs_new_protected:Npn \__pdf_backend_object_write_array:nn #1#2 |
| 679 |
{ |
| 680 |
\__pdf_backend:e |
| 681 |
{ obj ~ #1 ~ [ ~ \exp_not:n {#2} ~ ] } |
| 682 |
} |
| 683 |
\cs_new_protected:Npn \__pdf_backend_object_write_dict:nn #1#2 |
| 684 |
{ |
| 685 |
\__pdf_backend:e |
| 686 |
{ obj ~ #1 ~ << ~ \exp_not:n {#2} ~ >> } |
| 687 |
} |
| 688 |
\cs_new_protected:Npn \__pdf_backend_object_write_fstream:nn #1#2 |
| 689 |
{ \__pdf_backend_object_write_stream:nnnn { f } {#1} #2 } |
| 690 |
\cs_new_protected:Npn \__pdf_backend_object_write_stream:nn #1#2 |
| 691 |
{ \__pdf_backend_object_write_stream:nnnn { } {#1} #2 } |
| 692 |
\cs_new_protected:Npn \__pdf_backend_object_write_stream:nnnn #1#2#3#4 |
| 693 |
{ |
| 694 |
\__pdf_backend:e |
| 695 |
{ |
| 696 |
#1 stream ~ #2 ~ |
| 697 |
( \exp_not:n {#4} ) ~ << \exp_not:n {#3} >> |
| 698 |
} |
| 699 |
} |
| 700 |
\cs_new_protected:Npn \__pdf_backend_object_now:nn #1#2 |
| 701 |
{ |
| 702 |
\int_gincr:N \g__pdf_backend_object_int |
| 703 |
\exp_args:Nne \use:c { __pdf_backend_object_write_ #1 :nn } |
| 704 |
{ @pdf.obj \int_use:N \g__pdf_backend_object_int } |
| 705 |
{#2} |
| 706 |
} |
| 707 |
\cs_generate_variant:Nn \__pdf_backend_object_now:nn { ne } |
| 708 |
\cs_new:Npn \__pdf_backend_object_last: |
| 709 |
{ @pdf.obj \int_use:N \g__pdf_backend_object_int } |
| 710 |
\cs_new:Npn \__pdf_backend_pageobject_ref:n #1 |
| 711 |
{ @page #1 } |
| 712 |
\cs_new_protected:Npn \__pdf_backend_destination:nn #1#2 |
| 713 |
{ |
| 714 |
\__pdf_backend:e |
| 715 |
{ |
| 716 |
dest ~ ( \exp_not:n {#1} ) |
| 717 |
[ |
| 718 |
@thispage |
| 719 |
\str_case:nnF {#2} |
| 720 |
{ |
| 721 |
{ xyz } { /XYZ ~ @xpos ~ @ypos ~ null } |
| 722 |
{ fit } { /Fit } |
| 723 |
{ fitb } { /FitB } |
| 724 |
{ fitbh } { /FitBH } |
| 725 |
{ fitbv } { /FitBV ~ @xpos } |
| 726 |
{ fith } { /FitH ~ @ypos } |
| 727 |
{ fitv } { /FitV ~ @xpos } |
| 728 |
{ fitr } { /Fit } |
| 729 |
} |
| 730 |
{ /XYZ ~ @xpos ~ @ypos ~ \fp_eval:n { (#2) / 100 } } |
| 731 |
] |
| 732 |
} |
| 733 |
} |
| 734 |
\cs_new_protected:Npn \__pdf_backend_destination:nnnn #1#2#3#4 |
| 735 |
{ |
| 736 |
\exp_args:Ne \__pdf_backend_destination_aux:nnnn |
| 737 |
{ \dim_eval:n {#2} } {#1} {#3} {#4} |
| 738 |
} |
| 739 |
\cs_new_protected:Npn \__pdf_backend_destination_aux:nnnn #1#2#3#4 |
| 740 |
{ |
| 741 |
\vbox_to_zero:n |
| 742 |
{ |
| 743 |
\dim_vertical:n {#4} |
| 744 |
\hbox:n |
| 745 |
{ |
| 746 |
\__pdf_backend:n { obj ~ @pdf_ #2 _llx ~ @xpos } |
| 747 |
\__pdf_backend:n { obj ~ @pdf_ #2 _lly ~ @ypos } |
| 748 |
} |
| 749 |
\tex_vss:D |
| 750 |
} |
| 751 |
\dim_horizontal:n {#1} |
| 752 |
\vbox_to_zero:n |
| 753 |
{ |
| 754 |
\dim_vertical:n { -#3 } |
| 755 |
\hbox:n |
| 756 |
{ |
| 757 |
\__pdf_backend:n |
| 758 |
{ |
| 759 |
dest ~ (#2) |
| 760 |
[ |
| 761 |
@thispage |
| 762 |
/FitR ~ |
| 763 |
@pdf_ #2 _llx ~ @pdf_ #2 _lly ~ |
| 764 |
@xpos ~ @ypos |
| 765 |
] |
| 766 |
} |
| 767 |
} |
| 768 |
\tex_vss:D |
| 769 |
} |
| 770 |
\dim_horizontal:n { -#1 } |
| 771 |
} |
| 772 |
\cs_new_protected:Npn \__pdf_backend_compresslevel:n #1 |
| 773 |
{ \__kernel_backend_literal:e { dvipdfmx:config~z~ \int_eval:n {#1} } } |
| 774 |
\cs_new_protected:Npn \__pdf_backend_compress_objects:n #1 |
| 775 |
{ |
| 776 |
\bool_if:nF {#1} |
| 777 |
{ \__kernel_backend_literal:n { dvipdfmx:config~C~0x40 } } |
| 778 |
} |
| 779 |
\cs_new_protected:Npn \__pdf_backend_version_major_gset:n #1 |
| 780 |
{ |
| 781 |
\cs_gset:Npe \__pdf_backend_version_major: { \int_eval:n {#1} } |
| 782 |
\__kernel_backend_literal:e { pdf:majorversion~ \__pdf_backend_version_major: } |
| 783 |
} |
| 784 |
\cs_new_protected:Npn \__pdf_backend_version_minor_gset:n #1 |
| 785 |
{ |
| 786 |
\cs_gset:Npe \__pdf_backend_version_minor: { \int_eval:n {#1} } |
| 787 |
\__kernel_backend_literal:e { pdf:minorversion~ \__pdf_backend_version_minor: } |
| 788 |
} |
| 789 |
\cs_new:Npn \__pdf_backend_version_major: { 1 } |
| 790 |
\cs_new:Npn \__pdf_backend_version_minor: { 7 } |
| 791 |
\cs_new_protected:Npn \__pdf_backend_bdc:nn #1#2 |
| 792 |
{ \__kernel_backend_literal_page:n { /#1 ~ #2 ~ BDC } } |
| 793 |
\cs_new_protected:Npn \__pdf_backend_emc: |
| 794 |
{ \__kernel_backend_literal_page:n { EMC } } |
| 795 |
\cs_new_protected:Npn \__pdf_backend_pagesize_gset:nn #1#2 |
| 796 |
{ |
| 797 |
\dim_gset:Nn \tex_pagewidth:D {#1} |
| 798 |
\dim_gset:Nn \tex_pageheight:D {#2} |
| 799 |
} |
| 800 |
%% File: l3backend-pdfannot.dtx |
| 801 |
\cs_new_protected:Npe \__pdfannot_backend:n #1 |
| 802 |
{ \__kernel_backend_literal:n { pdf: #1 } } |
| 803 |
\cs_generate_variant:Nn \__pdfannot_backend:n { e } |
| 804 |
\int_new:N \g__pdfannot_backend_int |
| 805 |
\cs_new_protected:Npn \__pdfannot_backend_generic:nnnn #1#2#3#4 |
| 806 |
{ |
| 807 |
\int_gincr:N \g__pdfannot_backend_int |
| 808 |
\__pdfannot_backend:e |
| 809 |
{ |
| 810 |
ann ~ @pdfannot \int_use:N \g__pdfannot_backend_int \c_space_tl |
| 811 |
width ~ \dim_eval:n {#1} ~ |
| 812 |
height ~ \dim_eval:n {#2} ~ |
| 813 |
depth ~ \dim_eval:n {#3} ~ |
| 814 |
<< /Type /Annot #4 >> |
| 815 |
} |
| 816 |
} |
| 817 |
\cs_new:Npn \__pdfannot_backend_last: |
| 818 |
{ @pdfannot \int_use:N \g__pdfannot_backend_int } |
| 819 |
\int_new:N \g__pdfannot_backend_link_int |
| 820 |
\cs_new_protected:Npn \__pdfannot_backend_link_begin_goto:nnw #1#2 |
| 821 |
{ |
| 822 |
\__pdfannot_backend_link_begin:n |
| 823 |
{ #1 /Subtype /Link /A << /S /GoTo /D ( #2 ) >> } |
| 824 |
} |
| 825 |
\cs_new_protected:Npn \__pdfannot_backend_link_begin_user:nnw #1#2 |
| 826 |
{ \__pdfannot_backend_link_begin:n {#1#2} } |
| 827 |
\cs_new_protected:Npe \__pdfannot_backend_link_begin:n #1 |
| 828 |
{ |
| 829 |
\int_gincr:N \exp_not:N \g__pdfannot_backend_int |
| 830 |
\int_gset_eq:NN \exp_not:N \g__pdfannot_backend_link_int |
| 831 |
\exp_not:N \g__pdfannot_backend_int |
| 832 |
\__pdfannot_backend:e |
| 833 |
{ |
| 834 |
bann ~ |
| 835 |
@pdfannot |
| 836 |
\exp_not:N \int_use:N \exp_not:N \g__pdfannot_backend_link_int |
| 837 |
\c_space_tl |
| 838 |
<< |
| 839 |
/Type /Annot |
| 840 |
#1 |
| 841 |
>> |
| 842 |
} |
| 843 |
} |
| 844 |
\cs_new_protected:Npn \__pdfannot_backend_link_end: |
| 845 |
{ \__pdfannot_backend:n { eann } } |
| 846 |
\cs_new:Npn \__pdfannot_backend_link_last: |
| 847 |
{ @pdfannot \int_use:N \g__pdfannot_backend_link_int } |
| 848 |
\cs_new_protected:Npn \__pdfannot_backend_link_margin:n #1 |
| 849 |
{ \__kernel_backend_literal:e { dvipdfmx:config~g~ \dim_eval:n {#1} } } |
| 850 |
\cs_new_protected:Npn \__pdfannot_backend_link_on: { \__pdfannot_backend:n { link } } |
| 851 |
\cs_new_protected:Npn \__pdfannot_backend_link_off: { \__pdfannot_backend:n { nolink } } |
| 852 |
\cs_new_eq:NN \__pdf_backend_annotation:nnnn \__pdfannot_backend_generic:nnnn |
| 853 |
\cs_new_eq:NN \__pdf_backend_annotation_last: \__pdfannot_backend_last: |
| 854 |
\clist_map_inline:nn |
| 855 |
{ |
| 856 |
begin_goto:nnw , |
| 857 |
begin_user:nnw , |
| 858 |
begin:nnnw , |
| 859 |
end: , |
| 860 |
last: , |
| 861 |
margin:n |
| 862 |
} |
| 863 |
{ \cs_new_eq:cc { __pdf_backend_link_ #1 } { __pdfannot_backend_link_ #1 } } |
| 864 |
%% File: l3backend-opacity.dtx |
| 865 |
\bool_lazy_and:nnT |
| 866 |
{ \cs_if_exist_p:N \pdfmanagement_if_active_p: } |
| 867 |
{ \pdfmanagement_if_active_p: } |
| 868 |
{ |
| 869 |
\pdfmanagement_add:nnn { Page / Resources / ExtGState } |
| 870 |
{ opacity 1 } { << /ca ~ 1 /CA ~ 1 >> } |
| 871 |
} |
| 872 |
\tl_new:N \l__opacity_backend_fill_tl |
| 873 |
\tl_new:N \l__opacity_backend_stroke_tl |
| 874 |
\tl_set:Nn \l__opacity_backend_fill_tl { 1 } |
| 875 |
\tl_set:Nn \l__opacity_backend_stroke_tl { 1 } |
| 876 |
\cs_new_protected:Npn \__opacity_backend_select:n #1 |
| 877 |
{ |
| 878 |
\tl_set:Nn \l__opacity_backend_fill_tl {#1} |
| 879 |
\tl_set:Nn \l__opacity_backend_stroke_tl {#1} |
| 880 |
\pdfmanagement_add:nnn { Page / Resources / ExtGState } |
| 881 |
{ opacity #1 } |
| 882 |
{ << /ca ~ #1 /CA ~ #1 >> } |
| 883 |
\__kernel_backend_literal_pdf:n |
| 884 |
{ /opacity #1 ~ gs } |
| 885 |
} |
| 886 |
\cs_new_protected:Npn \__opacity_backend_reset: |
| 887 |
{ |
| 888 |
\__kernel_backend_literal_pdf:n |
| 889 |
{ /opacity1 ~ gs } |
| 890 |
} |
| 891 |
\cs_new_eq:NN \__opacity_backend_reset_fill: \__opacity_backend_reset: |
| 892 |
\cs_new_eq:NN \__opacity_backend_reset_stroke: \__opacity_backend_reset: |
| 893 |
\cs_new_protected:Npn \__opacity_backend_fill:n #1 |
| 894 |
{ |
| 895 |
\exp_args:Nno \__opacity_backend_fill_stroke:nn |
| 896 |
{ #1 } |
| 897 |
{ \l__opacity_backend_stroke_tl } |
| 898 |
} |
| 899 |
\cs_new_protected:Npn \__opacity_backend_stroke:n #1 |
| 900 |
{ |
| 901 |
\exp_args:No \__opacity_backend_fill_stroke:nn |
| 902 |
{ \l__opacity_backend_fill_tl } |
| 903 |
{ #1 } |
| 904 |
} |
| 905 |
\cs_new_protected:Npn \__opacity_backend_fill_stroke:nn #1#2 |
| 906 |
{ |
| 907 |
\str_if_eq:nnTF {#1} {#2} |
| 908 |
{ \__opacity_backend_select:n {#1} } |
| 909 |
{ |
| 910 |
\tl_set:Nn \l__opacity_backend_fill_tl {#1} |
| 911 |
\tl_set:Nn \l__opacity_backend_stroke_tl {#2} |
| 912 |
\pdfmanagement_add:nnn { Page / Resources / ExtGState } |
| 913 |
{ opacity.fill #1 } |
| 914 |
{ << /ca ~ #1 >> } |
| 915 |
\pdfmanagement_add:nnn { Page / Resources / ExtGState } |
| 916 |
{ opacity.stroke #2 } |
| 917 |
{ << /CA ~ #2 >> } |
| 918 |
\__kernel_backend_literal_pdf:n |
| 919 |
{ /opacity.fill #1 ~ gs /opacity.stroke #2 ~ gs } |
| 920 |
} |
| 921 |
} |
| 922 |
\bool_lazy_and:nnF |
| 923 |
{ \cs_if_exist_p:N \pdfmanagement_if_active_p: } |
| 924 |
{ \pdfmanagement_if_active_p: } |
| 925 |
{ |
| 926 |
\cs_gset_protected:Npn \__opacity_backend_select:n #1 { } |
| 927 |
\cs_gset_protected:Npn \__opacity_backend_fill_stroke:nn #1#2 { } |
| 928 |
\cs_gset_protected:Npn \__opacity_backend_reset: { } |
| 929 |
\cs_gset_eq:NN \__opacity_backend_reset_fill: \__opacity_backend_reset: |
| 930 |
\cs_gset_eq:NN \__opacity_backend_reset_stroke: \__opacity_backend_reset: |
| 931 |
} |
| 932 |
%% |
| 933 |
%% |
| 934 |
%% End of file `l3backend-xetex.def'. |