Function: svg-path

svg-path is a byte-compiled function defined in svg.el.gz.

Signature

(svg-path SVG COMMANDS &rest ARGS)

Documentation

Add the outline of a shape to SVG according to COMMANDS.

Coordinates by default are absolute. ARGS is a plist of modifiers. If :relative is t, then coordinates are relative to the last position, or -- initially -- to the origin.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/svg.el.gz
(defun svg-path (svg commands &rest args)
  "Add the outline of a shape to SVG according to COMMANDS.
Coordinates by default are absolute.  ARGS is a plist of
modifiers.  If :relative is t, then coordinates are relative to
the last position, or -- initially -- to the origin."
  (let* ((default-relative (plist-get args :relative))
         (stripped-args (svg--plist-delete args :relative))
         (d (mapconcat #'identity
                       (mapcar
                        (lambda (command)
                          (svg--eval-path-command command
                                                  default-relative))
                        commands) " ")))
    (svg--append
     svg
     (dom-node 'path
               `((d . ,d)
                 ,@(svg--arguments svg stripped-args))))))