[latex3-commits] [l3svn] 08/08: Basic image support for dvisvgm

noreply at latex-project.org noreply at latex-project.org
Sun Jun 4 11:46:48 CEST 2017


This is an automated email from the git hooks/post-receive script.

joseph pushed a commit to branch master
in repository l3svn.

commit 13a3f79bd33ba19bc6622d82358c7820c3d8e1aa
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sun Jun 4 09:44:57 2017 +0200

    Basic image support for dvisvgm
    
    The native special doesn't allow all of the effects in the current
    dvisvgm.def, but they are currently intended to be applied using
    box operations. Some testing will be needed here and elsewhere to
    establish if that works.
---
 l3kernel/l3drivers.dtx |   35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index c823884..6fe35dc 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -2361,6 +2361,41 @@
 % \end{macro}
 % \end{macro}
 %
+% \subsection{Images}
+%
+% \begin{macro}[int]{\@@_image_getbb_png:n, \@@_image_getbb_jpg:n}
+%   These can be included by extracting the bounding box data.
+%    \begin{macrocode}
+\cs_new_eq:NN \@@_image_getbb_png:n \__image_extract_bb:n
+\cs_new_eq:NN \@@_image_getbb_jpg:n \__image_extract_bb:n
+%    \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}[int]{\@@_image_include_png:n, \@@_image_include_jpg:n}
+% \begin{macro}[aux]{\@@_image_include_bitmap_quote:w}
+%   The driver here has built-in support for basic image inclusion (see
+%   \texttt{dvisvgm.def} for a more complex approach, needed if clipping,
+%   \emph{etc.}, is covered at the image driver level). The only issue is
+%   that |#1| must be quoted corrected. The \texttt{dvisvgm:img} operation
+%   will quote the file name, but if it is already quoted (contains spaces)
+%   then we have an issue: we simply strip off any quotes as a result.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_image_include_png:n #1
+  {
+     \tex_special:D
+       {
+         dvisvgm:img~
+         \dim_to_decimal:n { \l__image_ury_dim } ~
+         \dim_to_decimal:n { \l__image_ury_dim } ~
+         \@@_image_include_bitmap_quote:w #1 " " \q_stop
+       }
+  }
+\cs_new_eq:NN \@@_image_include_jpg:n \@@_image_include_png:n
+\cs_new:Npn \@@_image_include_bitmap_quote:w #1 " #2 " #3 \q_stop { #1#2 }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
 % \subsection{Drawing}
 %
 % \begin{macro}[aux]{\@@_draw_literal:n, \@@_draw_literal:x}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the latex3-commits mailing list