]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-markup-commands.scm
use -dbackend=eps iso. --backend=eps for setting backend.
[lilypond.git] / scm / define-markup-commands.scm
index 45833f08e0abf7e41cb01c8a31c3a1edaa704948..42ce759bb7c31cea59d90456db7e45c97d933511 100644 (file)
 ;; geometric shapes
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
+(define-builtin-markup-command (draw-line layout props dest)
+  (number-pair?)
+  "A simple line. Uses the @code{thickness} property. "
+  (let*
+      ((th (chain-assoc-get 'thickness props  0.1))
+       (x (car dest))
+       (y (cdr dest)))
+
+    (ly:make-stencil
+     `(draw-line
+       ,th
+       0 0
+       ,x ,y)
+
+     (cons (min x 0) (min y 0))
+     (cons (max x 0) (max y 0)))))
+
 (define-builtin-markup-command (draw-circle layout props radius thickness fill)
   (number? number? boolean?)
   "A circle of radius @var{radius}, thickness @var{thickness} and
@@ -72,6 +89,7 @@ the PDF backend."
         (yextent (ly:stencil-extent stil Y))
         (old-expr (ly:stencil-expr stil))
         (url-expr (list 'url-link url `(quote ,xextent) `(quote ,yextent))))
+
     (ly:stencil-add (ly:make-stencil url-expr xextent yextent) stil)))
 
 
@@ -292,11 +310,6 @@ grestore
                           ;(map (lambda (s) (interpret-markup layout props s)) parts))
       (interpret-markup layout props str)))
 
-
-;; TODO: use font recoding.
-;;                   (make-line-markup
-;;                    (map make-word-markup (string-tokenize str)))))
-
 (define-public empty-markup
   (make-simple-markup ""))