blob: c3cae34968c88c8301f34cd6cf13a36df9780cde (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
%%
%% This is file `l3xdvipdfmx.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3drivers.dtx (with options: `package,xdvipdfmx')
%%
%% EXPERIMENTAL CODE
%%
%% Do not distribute this file without also distributing the
%% source files specified above.
%%
%% Do not distribute a modified version of this file.
%%
%% File: l3drivers.dtx Copyright(C) 2011-2016 The LaTeX3 Project
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version. The latest version
%% of this license is in the file
%%
%% http://www.latex-project.org/lppl.txt
%%
%% This file is part of the "l3kernel bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
%% The released version of this bundle is available from CTAN.
%%
%% -----------------------------------------------------------------------
%%
%% The development version of the bundle can be found at
%%
%% http://www.latex-project.org/svnroot/experimental/trunk/
%%
%% for those people who are interested.
%%
%%%%%%%%%%%
%% NOTE: %%
%%%%%%%%%%%
%%
%% Snapshots taken from the repository represent work in progress and may
%% not work or may contain conflicting material! We therefore ask
%% people _not_ to put them into distributions, archives, etc. without
%% prior consultation with the LaTeX Project Team.
%%
%% -----------------------------------------------------------------------
%%
\GetIdInfo$Id: l3drivers.dtx 6644 2016-08-13 20:22:11Z bruno $
{L3 Experimental drivers}
\ProvidesExplFile
{l3xdvidpfmx.def}{\ExplFileDate}{\ExplFileVersion}
{L3 Experimental driver: xdvipdfmx}
\cs_new_protected:Npn \__driver_literal:n #1
{ \tex_special:D { pdf:literal~ #1 } }
\cs_new_protected:Npn \__driver_scope_begin:
{ \__driver_literal:n { q } }
\cs_new_protected:Npn \__driver_scope_end:
{ \__driver_literal:n { Q } }
\cs_new_protected:Npn \__driver_matrix:n #1
{ \__driver_literal:n { #1 \c_space_tl 0~0~cm } }
\tl_new:N \l__driver_current_color_tl
\tl_set:Nn \l__driver_current_color_tl { [ 0 ] }
\AtBeginDocument
{
\@ifpackageloaded { color }
{ \tl_set:Nn \l__driver_current_color_tl { \current@color } }
{ }
}
\cs_new_protected:Npn \__driver_color_ensure_current:
{
\tex_special:D { pdf:bcolor~\l__driver_current_color_tl }
\group_insert_after:N \__driver_color_reset:
}
\cs_new_protected:Npn \__driver_color_reset:
{ \tex_special:D { pdf:ecolor } }
\AtBeginDocument
{
\@ifpackageloaded { color }
{
\cs_set_protected:Npn \__driver_color_ensure_current:
{
\tex_special:D { color~push~\l__driver_current_color_tl }
\group_insert_after:N \__driver_color_reset:
}
\cs_set_protected:Npn \__driver_color_reset:
{ \tex_special:D { color~pop } }
}
{ }
}
\cs_new_protected:Npn \__driver_box_use_clip:N #1
{
\__driver_scope_begin:
\__driver_literal:n
{
0~
\dim_to_decimal_in_bp:n { -\box_dp:N #1 } ~
\dim_to_decimal_in_bp:n { \box_wd:N #1 } ~
\dim_to_decimal_in_bp:n { \box_ht:N #1 + \box_dp:N #1 } ~
re~W~n
}
\hbox_overlap_right:n { \box_use:N #1 }
\__driver_scope_end:
\skip_horizontal:n { \box_wd:N #1 }
}
\cs_new_protected:Npn \__driver_box_use_rotate:Nn #1#2
{
\__driver_scope_begin:
\box_set_wd:Nn #1 \c_zero_dim
\fp_set:Nn \l__driver_cos_fp { round ( cosd ( #2 ) , 5 ) }
\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
{
\fp_use:N \l__driver_cos_fp \c_space_tl
\fp_compare:nNnTF \l__driver_sin_fp = \c_zero_fp
{ 0~0 }
{
\fp_use:N \l__driver_sin_fp
\c_space_tl
\fp_eval:n { -\l__driver_sin_fp }
}
\c_space_tl
\fp_use:N \l__driver_cos_fp
}
\box_use:N #1
\__driver_scope_end:
}
\fp_new:N \l__driver_cos_fp
\fp_new:N \l__driver_sin_fp
\cs_new_protected:Npn \__driver_box_use_scale:Nnn #1#2#3
{
\__driver_scope_begin:
\__driver_matrix:n
{
\fp_eval:n { round ( #2 , 5 ) } ~
0~0~
\fp_eval:n { round ( #3 , 5 ) }
}
\hbox_overlap_right:n { \box_use:N #1 }
\__driver_scope_end:
}
\cs_new_eq:NN \__driver_draw_literal:n \__driver_literal: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_protected:Npn \__driver_draw_moveto:nn #1#2
{
\__driver_draw_literal:x
{ \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ m }
}
\cs_new_protected:Npn \__driver_draw_lineto:nn #1#2
{
\__driver_draw_literal:x
{ \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~ l }
}
\cs_new_protected:Npn \__driver_draw_curveto:nnnnnn #1#2#3#4#5#6
{
\__driver_draw_literal:x
{
\dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~
\dim_to_decimal_in_bp:n {#3} ~ \dim_to_decimal_in_bp:n {#4} ~
\dim_to_decimal_in_bp:n {#5} ~ \dim_to_decimal_in_bp:n {#6} ~
c
}
}
\cs_new_protected:Npn \__driver_draw_rectangle:nnnn #1#2#3#4
{
\__driver_draw_literal:x
{
\dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~
\dim_to_decimal_in_bp:n {#3} ~ \dim_to_decimal_in_bp:n {#4} ~
re
}
}
\cs_new_protected:Npn \__driver_draw_evenodd_rule:
{ \bool_gset_true:N \g__driver_draw_eor_bool }
\cs_new_protected:Npn \__driver_draw_nonzero_rule:
{ \bool_gset_false:N \g__driver_draw_eor_bool }
\bool_new:N \g__driver_draw_eor_bool
\cs_new_protected:Npn \__driver_draw_closepath:
{ \__driver_draw_literal:n { h } }
\cs_new_protected:Npn \__driver_draw_stroke:
{ \__driver_draw_literal:n { S } }
\cs_new_protected:Npn \__driver_draw_closestroke:
{ \__driver_draw_literal:n { s } }
\cs_new_protected:Npn \__driver_draw_fill:
{
\__driver_draw_literal:x
{ f \bool_if:NT \g__driver_draw_eor_bool * }
}
\cs_new_protected:Npn \__driver_draw_fillstroke:
{
\__driver_draw_literal:x
{ B \bool_if:NT \g__driver_draw_eor_bool * }
}
\cs_new_protected:Npn \__driver_draw_clip:
{
\__driver_draw_literal:x
{ W \bool_if:NT \g__driver_draw_eor_bool * }
}
\cs_new_protected:Npn \__driver_draw_discardpath:
{ \__driver_draw_literal:n { n } }
\cs_new_protected:Npn \__driver_draw_dash:nn #1#2
{
\__driver_draw_literal:x
{
[ ~
\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} ~ }
\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 { \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:
{ \__driver_draw_literal:n { 1 ~ J } }
\cs_new_protected:Npn \__driver_draw_cap_rectangle:
{ \__driver_draw_literal:n { 2 ~ J } }
\cs_new_protected:Npn \__driver_draw_join_miter:
{ \__driver_draw_literal:n { 0 ~ j } }
\cs_new_protected:Npn \__driver_draw_join_round:
{ \__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
{
\use:x
{
\__driver_draw_color_cmyk_aux:nnnn
{ \fp_eval:n {#1} }
{ \fp_eval:n {#2} }
{ \fp_eval:n {#3} }
{ \fp_eval:n {#4} }
}
}
\cs_new_protected:Npn \__driver_draw_color_cmyk_aux:nnnn #1#2#3#4
{
\__driver_draw_literal:n
{ #1 ~ #2 ~ #3 ~ #4 ~ k ~ #1 ~ #2 ~ #3 ~ #4 ~ K }
}
\cs_new_protected:Npn \__driver_draw_color_cmyk_fill:nnnn #1#2#3#4
{
\__driver_draw_literal: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_cmyk_stroke:nnnn #1#2#3#4
{
\__driver_draw_literal: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_gray:n #1
{
\use:x
{ \__driver_draw_color_gray_aux:n { \fp_eval:n {#1} } }
}
\cs_new_protected:Npn \__driver_draw_color_gray_aux:n #1
{
\__driver_draw_literal:n { #1 ~ g ~ #1 ~ G }
}
\cs_new_protected:Npn \__driver_draw_color_gray_fill:n #1
{ \__driver_draw_literal:x { \fp_eval:n {#1} ~ g } }
\cs_new_protected:Npn \__driver_draw_color_gray_stroke:n #1
{ \__driver_draw_literal:x { \fp_eval:n {#1} ~ G } }
\cs_new_protected:Npn \__driver_draw_color_rgb:nnn #1#2#3
{
\use:x
{
\__driver_draw_color_rgb_aux:nnn
{ \fp_eval:n {#1} }
{ \fp_eval:n {#2} }
{ \fp_eval:n {#3} }
}
}
\cs_new_protected:Npn \__driver_draw_color_rgb_aux:nnn #1#2#3
{
\__driver_draw_literal:n
{ #1 ~ #2 ~ #3 ~ rg ~ #1 ~ #2 ~ #3 ~ RG }
}
\cs_new_protected:Npn \__driver_draw_color_rgb_fill:nnn #1#2#3
{
\__driver_draw_literal:x
{ \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ rg }
}
\cs_new_protected:Npn \__driver_draw_color_rgb_stroke:nnn #1#2#3
{
\__driver_draw_literal:x
{ \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ RG }
}
\cs_new_protected:Npn \__driver_draw_transformcm:nnnnnn #1#2#3#4#5#6
{
\__driver_draw_literal:x
{
\fp_eval:n {#1} ~ \fp_eval:n {#2} ~
\fp_eval:n {#3} ~ \fp_eval:n {#4} ~
\dim_to_decimal_in_bp:n {#5} ~ \dim_to_decimal_in_bp:n {#6} ~
cm
}
}
\cs_new_protected:Npn \__driver_draw_hbox:Nnnnnnn #1#2#3#4#5#6#7
{
\hbox_set:Nn \l__driver_tmp_box
{
\tex_kern:D \__dim_eval:w #6 \__dim_eval_end:
\__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:
}
\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
}
\box_new:N \l__driver_tmp_box
%%
%%
%% End of file `l3xdvipdfmx.def'.
|