[latex3-commits] [git/LaTeX3-latex3-latex3] master: l3draw: Basic path curve support (e414956)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun Feb 11 13:19:24 CET 2018


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/e41495668cf356d005f89380287b2b39154ec94f

>---------------------------------------------------------------

commit e41495668cf356d005f89380287b2b39154ec94f
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Feb 11 12:19:24 2018 +0000

    l3draw: Basic path curve support


>---------------------------------------------------------------

e41495668cf356d005f89380287b2b39154ec94f
 l3trial/l3draw/l3draw-paths.dtx              |   22 ++++++++++++++++++++++
 l3trial/l3draw/l3draw.dtx                    |    6 ++++++
 l3trial/l3draw/testfiles/m3draw003.lvt       |   11 +++++++++++
 l3trial/l3draw/testfiles/m3draw003.ptex.tlg  |   13 +++++++++++++
 l3trial/l3draw/testfiles/m3draw003.tlg       |   13 +++++++++++++
 l3trial/l3draw/testfiles/m3draw003.uptex.tlg |   13 +++++++++++++
 l3trial/l3draw/testfiles/m3draw003.xetex.tlg |   13 +++++++++++++
 7 files changed, 91 insertions(+)

diff --git a/l3trial/l3draw/l3draw-paths.dtx b/l3trial/l3draw/l3draw-paths.dtx
index db9a924..e30cdf7 100644
--- a/l3trial/l3draw/l3draw-paths.dtx
+++ b/l3trial/l3draw/l3draw-paths.dtx
@@ -138,6 +138,8 @@
 %
 % \begin{macro}{\draw_path_moveto:n, \draw_path_lineto:n}
 % \begin{macro}{\@@_path_moveto:nn, \@@_path_lineto:nn}
+% \begin{macro}{\draw_path_curveto:nnn}
+% \begin{macro}{\@@_path_curveto:nnnnnn}
 %   At present, stick to purely linear transformation support and skip the
 %   soft path business: that will likely need to be revisited later.
 %    \begin{macrocode}
@@ -165,9 +167,29 @@
      \driver_draw_lineto:nn {#1} {#2}
      \@@_path_update_last:nn {#1} {#2}
   }
+\cs_new_protected:Npn \draw_path_curveto:nnn #1#2#3
+  {
+    \@@_point_process:nn
+      { \@@_path_curveto:nnnnnn }
+      {
+        \draw_point_transform:n {#1}
+        \draw_point_transform:n {#2}
+        \draw_point_transform:n {#3}
+      }
+  }
+\cs_new_protected:Npn \@@_path_curveto:nnnnnn #1#2#3#4#5#6
+  {
+     \@@_path_update_limits:nn {#1} {#2}
+     \@@_path_update_limits:nn {#3} {#4}
+     \@@_path_update_limits:nn {#5} {#6}
+     \driver_draw_curveto:nnnnnn {#1} {#2} {#3} {#4} {#5} {#6}
+     \@@_path_update_last:nn {#5} {#6}
+  }
 %    \end{macrocode}
 % \end{macro}
 % \end{macro}
+% \end{macro}
+% \end{macro}
 %
 %    \begin{macrocode}
 %</initex|package>
diff --git a/l3trial/l3draw/l3draw.dtx b/l3trial/l3draw/l3draw.dtx
index 89a036d..4bfdf4f 100644
--- a/l3trial/l3draw/l3draw.dtx
+++ b/l3trial/l3draw/l3draw.dtx
@@ -170,6 +170,12 @@
 %   \end{syntax}
 % \end{function}
 %
+% \begin{function}{\draw_path_curveto:nnn}
+%   \begin{syntax}
+%     \cs{draw_path_curveto:nnn} \marg{point expr1} \marg{point expr2} \marg{point expr3}
+%   \end{syntax}
+% \end{function}
+%
 % \subsection{Transformations}
 %
 % \begin{function}{\draw_transform_reset:}
diff --git a/l3trial/l3draw/testfiles/m3draw003.lvt b/l3trial/l3draw/testfiles/m3draw003.lvt
index 5701089..44e91f1 100644
--- a/l3trial/l3draw/testfiles/m3draw003.lvt
+++ b/l3trial/l3draw/testfiles/m3draw003.lvt
@@ -40,4 +40,15 @@
       { \draw_path_lineto:n { { 10pt } { 10pt } } }
   }
 
+\TEST { \draw_path_curveto:nnn }
+  {
+    \test:n
+      {
+        \draw_path_curveto:nnn
+          { \draw_point_vec_coord:nn { 0 } { 1 } }
+          { \draw_point_vec_coord:nn { 1 } { 1 } }
+          { \draw_point_vec_coord:nn { 1 } { 2 } }
+      }
+  }
+
 \END
diff --git a/l3trial/l3draw/testfiles/m3draw003.ptex.tlg b/l3trial/l3draw/testfiles/m3draw003.ptex.tlg
index cfcd369..3cf19cc 100644
--- a/l3trial/l3draw/testfiles/m3draw003.ptex.tlg
+++ b/l3trial/l3draw/testfiles/m3draw003.ptex.tlg
@@ -26,3 +26,16 @@ TEST 2: \draw_path_lineto:n
 <argument> \l_tmpa_box 
 l. ...  }
 ============================================================
+============================================================
+TEST 3: \draw_path_curveto:nnn 
+============================================================
+> \box...=
+\hbox(0.0+0.0)x0.0
+.\hbox(0.0+0.0)x0.0
+..\special{pdf:literal q}
+..\special{pdf:literal 0 28.34645 28.34645 28.34645 28.34645 56.69289 c}
+..\special{pdf:literal Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+============================================================
diff --git a/l3trial/l3draw/testfiles/m3draw003.tlg b/l3trial/l3draw/testfiles/m3draw003.tlg
index 3943e7d..6884d71 100644
--- a/l3trial/l3draw/testfiles/m3draw003.tlg
+++ b/l3trial/l3draw/testfiles/m3draw003.tlg
@@ -26,3 +26,16 @@ TEST 2: \draw_path_lineto:n
 <argument> \l_tmpa_box 
 l. ...  }
 ============================================================
+============================================================
+TEST 3: \draw_path_curveto:nnn 
+============================================================
+> \box...=
+\hbox(0.0+0.0)x0.0
+.\hbox(0.0+0.0)x0.0
+..\pdfliteral{q}
+..\pdfliteral{0 28.34645 28.34645 28.34645 28.34645 56.69289 c}
+..\pdfliteral{Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+============================================================
diff --git a/l3trial/l3draw/testfiles/m3draw003.uptex.tlg b/l3trial/l3draw/testfiles/m3draw003.uptex.tlg
index cfcd369..3cf19cc 100644
--- a/l3trial/l3draw/testfiles/m3draw003.uptex.tlg
+++ b/l3trial/l3draw/testfiles/m3draw003.uptex.tlg
@@ -26,3 +26,16 @@ TEST 2: \draw_path_lineto:n
 <argument> \l_tmpa_box 
 l. ...  }
 ============================================================
+============================================================
+TEST 3: \draw_path_curveto:nnn 
+============================================================
+> \box...=
+\hbox(0.0+0.0)x0.0
+.\hbox(0.0+0.0)x0.0
+..\special{pdf:literal q}
+..\special{pdf:literal 0 28.34645 28.34645 28.34645 28.34645 56.69289 c}
+..\special{pdf:literal Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+============================================================
diff --git a/l3trial/l3draw/testfiles/m3draw003.xetex.tlg b/l3trial/l3draw/testfiles/m3draw003.xetex.tlg
index cfcd369..3cf19cc 100644
--- a/l3trial/l3draw/testfiles/m3draw003.xetex.tlg
+++ b/l3trial/l3draw/testfiles/m3draw003.xetex.tlg
@@ -26,3 +26,16 @@ TEST 2: \draw_path_lineto:n
 <argument> \l_tmpa_box 
 l. ...  }
 ============================================================
+============================================================
+TEST 3: \draw_path_curveto:nnn 
+============================================================
+> \box...=
+\hbox(0.0+0.0)x0.0
+.\hbox(0.0+0.0)x0.0
+..\special{pdf:literal q}
+..\special{pdf:literal 0 28.34645 28.34645 28.34645 28.34645 56.69289 c}
+..\special{pdf:literal Q}
+! OK.
+<argument> \l_tmpa_box 
+l. ...  }
+============================================================





More information about the latex3-commits mailing list