summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/l3backend/l3backend-draw.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-12-15 03:01:18 +0000
committerNorbert Preining <norbert@preining.info>2021-12-15 03:01:18 +0000
commit0efaa39c6d0b17b58df9a68ae1319ea20aaabc28 (patch)
tree677b276738cd1c52e8778f985da1705c64a4b729 /macros/latex/contrib/l3backend/l3backend-draw.dtx
parent829614e28f2055883ff74da11eb4e5e57d199be3 (diff)
CTAN sync 202112150301
Diffstat (limited to 'macros/latex/contrib/l3backend/l3backend-draw.dtx')
-rw-r--r--macros/latex/contrib/l3backend/l3backend-draw.dtx80
1 files changed, 44 insertions, 36 deletions
diff --git a/macros/latex/contrib/l3backend/l3backend-draw.dtx b/macros/latex/contrib/l3backend/l3backend-draw.dtx
index d8e8a19226..6a9ac910c3 100644
--- a/macros/latex/contrib/l3backend/l3backend-draw.dtx
+++ b/macros/latex/contrib/l3backend/l3backend-draw.dtx
@@ -43,7 +43,7 @@
% }^^A
% }
%
-% \date{Released 2021-10-18}
+% \date{Released 2021-12-14}
%
% \maketitle
%
@@ -768,6 +768,14 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@@_backend_scope_begin:, \@@_backend_scope_end:}
+% Use the backend-level scope mechanisms.
+% \begin{macrocode}
+\cs_new_eq:NN \@@_backend_scope_begin: \__kernel_backend_scope_begin:
+\cs_new_eq:NN \@@_backend_scope_end: \__kernel_backend_scope_end:
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@@_backend_begin:, \@@_backend_end:}
% A drawing needs to be set up such that the co-ordinate system is
% translated. That is done inside a scope, which as described below
@@ -785,7 +793,7 @@
% \begin{macro}{\@@_backend_rectangle:nnnn}
% \begin{macro}{\@@_backend_curveto:nnnnnn}
% \begin{macro}{\@@_backend_add_to_path:n}
-% \begin{variable}{\g_@@_draw_path_tl}
+% \begin{variable}{\g_@@_backend_path_tl}
% Once again, some work is needed to get path constructs correct. Rather
% then write the values as they are given, the entire path needs to be
% collected up before being output in one go. For that we use a dedicated
@@ -826,14 +834,14 @@
}
\cs_new_protected:Npn \@@_backend_add_to_path:n #1
{
- \tl_gset:Nx \g_@@_draw_path_tl
+ \tl_gset:Nx \g_@@_backend_path_tl
{
- \g_@@_draw_path_tl
- \tl_if_empty:NF \g_@@_draw_path_tl { \c_space_tl }
+ \g_@@_backend_path_tl
+ \tl_if_empty:NF \g_@@_backend_path_tl { \c_space_tl }
#1
}
}
-\tl_new:N \g_@@_draw_path_tl
+\tl_new:N \g_@@_backend_path_tl
% \end{macrocode}
% \end{variable}
% \end{macro}
@@ -845,9 +853,9 @@
% The fill rules here have to be handled as scopes.
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_evenodd_rule:
- { \@@_backend_scope:n { fill-rule="evenodd" } }
+ { \__kernel_backend_scope:n { fill-rule="evenodd" } }
\cs_new_protected:Npn \@@_backend_nonzero_rule:
- { \@@_backend_scope:n { fill-rule="nonzero" } }
+ { \__kernel_backend_scope:n { fill-rule="nonzero" } }
% \end{macrocode}
% \end{macro}
%
@@ -876,33 +884,33 @@
{
\bool_if:NTF \g_@@_draw_clip_bool
{
- \int_gincr:N \g_@@_clip_path_int
+ \int_gincr:N \g__kernel_clip_path_int
\@@_backend_literal:x
{
- < clipPath~id = " l3cp \int_use:N \g_@@_clip_path_int " >
+ < clipPath~id = " l3cp \int_use:N \g__kernel_clip_path_int " >
{ ?nl }
- <path~d=" \g_@@_draw_path_tl "/> { ?nl }
+ <path~d=" \g_@@_backend_path_tl "/> { ?nl }
< /clipPath > { ? nl }
<
use~xlink:href =
- "\c_hash_str l3path \int_use:N \g_@@_path_int " ~
+ "\c_hash_str l3path \int_use:N \g_@@_backend_path_int " ~
#1
/>
}
- \@@_backend_scope:x
+ \__kernel_backend_scope:x
{
clip-path =
- "url( \c_hash_str l3cp \int_use:N \g_@@_clip_path_int)"
+ "url( \c_hash_str l3cp \int_use:N \g__kernel_clip_path_int)"
}
}
{
\@@_backend_literal:x
- { <path ~ d=" \g_@@_draw_path_tl " ~ #1 /> }
+ { <path ~ d=" \g_@@_backend_path_tl " ~ #1 /> }
}
- \tl_gclear:N \g_@@_draw_path_tl
+ \tl_gclear:N \g_@@_backend_path_tl
\bool_gset_false:N \g_@@_draw_clip_bool
}
-\int_new:N \g_@@_path_int
+\int_new:N \g_@@_backend_path_int
\cs_new_protected:Npn \@@_backend_stroke:
{ \@@_backend_path:n { style="fill:none" } }
\cs_new_protected:Npn \@@_backend_closestroke:
@@ -921,21 +929,21 @@
{
\bool_if:NT \g_@@_draw_clip_bool
{
- \int_gincr:N \g_@@_clip_path_int
+ \int_gincr:N \g__kernel_clip_path_int
\@@_backend_literal:x
{
- < clipPath~id = " l3cp \int_use:N \g_@@_clip_path_int " >
+ < clipPath~id = " l3cp \int_use:N \g__kernel_clip_path_int " >
{ ?nl }
- <path~d=" \g_@@_draw_path_tl "/> { ?nl }
+ <path~d=" \g_@@_backend_path_tl "/> { ?nl }
< /clipPath >
}
- \@@_backend_scope:x
+ \__kernel_backend_scope:x
{
clip-path =
- "url( \c_hash_str l3cp \int_use:N \g_@@_clip_path_int)"
+ "url( \c_hash_str l3cp \int_use:N \g__kernel_clip_path_int)"
}
}
- \tl_gclear:N \g_@@_draw_path_tl
+ \tl_gclear:N \g_@@_path_tl
\bool_gset_false:N \g_@@_draw_clip_bool
}
% \end{macrocode}
@@ -963,7 +971,7 @@
\use:x
{
\@@_backend_dash_aux:nn
- { \clist_map_function:nn {#1} \@@_backend_dash:n }
+ { \clist_map_function:nN {#1} \@@_backend_dash:n }
{ \dim_to_decimal:n {#2} }
}
}
@@ -971,11 +979,11 @@
{ , \dim_to_decimal_in_bp:n {#1} }
\cs_new_protected:Npn \@@_backend_dash_aux:nn #1#2
{
- \@@_backend_scope:x
+ \__kernel_backend_scope:x
{
stroke-dasharray =
"
- \tl_if_empty:oTF { \use_none:n #1 }
+ \tl_if_empty:nTF {#1}
{ none }
{ \use_none:n #1 }
" ~
@@ -983,21 +991,21 @@
}
}
\cs_new_protected:Npn \@@_backend_linewidth:n #1
- { \@@_backend_scope:x { stroke-width=" \dim_to_decimal:n {#1} " } }
+ { \__kernel_backend_scope:x { stroke-width=" \dim_to_decimal:n {#1} " } }
\cs_new_protected:Npn \@@_backend_miterlimit:n #1
- { \@@_backend_scope:x { stroke-miterlimit=" #1 " } }
+ { \__kernel_backend_scope:x { stroke-miterlimit=" #1 " } }
\cs_new_protected:Npn \@@_backend_cap_butt:
- { \@@_backend_scope:n { stroke-linecap="butt" } }
+ { \__kernel_backend_scope:n { stroke-linecap="butt" } }
\cs_new_protected:Npn \@@_backend_cap_round:
- { \@@_backend_scope:n { stroke-linecap="round" } }
+ { \__kernel_backend_scope:n { stroke-linecap="round" } }
\cs_new_protected:Npn \@@_backend_cap_rectangle:
- { \@@_backend_scope:n { stroke-linecap="square" } }
+ { \__kernel_backend_scope:n { stroke-linecap="square" } }
\cs_new_protected:Npn \@@_backend_join_miter:
- { \@@_backend_scope:n { stroke-linejoin="miter" } }
+ { \__kernel_backend_scope:n { stroke-linejoin="miter" } }
\cs_new_protected:Npn \@@_backend_join_round:
- { \@@_backend_scope:n { stroke-linejoin="round" } }
+ { \__kernel_backend_scope:n { stroke-linejoin="round" } }
\cs_new_protected:Npn \@@_backend_join_bevel:
- { \@@_backend_scope:n { stroke-linejoin="bevel" } }
+ { \__kernel_backend_scope:n { stroke-linejoin="bevel" } }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -1012,7 +1020,7 @@
% \begin{macrocode}
\cs_new_protected:Npn \@@_backend_cm:nnnn #1#2#3#4
{
- \@@_backend_scope:n
+ \__kernel_backend_scope:n
{
transform =
" matrix ( #1 , #2 , #3 , #4 , 0pt , 0pt ) "
@@ -1026,7 +1034,7 @@
% a scope. As there is nothing to re-box, just make the box passed of
% zero size.
% \begin{macrocode}
-\cs_new_protected:Npn \@@_backend_box_use:Nnnnn #1#2#3#4#5#6#7
+\cs_new_protected:Npn \@@_backend_box_use:Nnnnn #1#2#3#4#5
{
\__kernel_backend_scope_begin:
\@@_backend_cm:nnnn {#2} {#3} {#4} {#5}