]> 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 12dd691634b4bf127761ac77f29056e1dcf1145e..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 ""))
 
@@ -848,10 +861,7 @@ any sort of property supported by @internalsref{font-interface} and
                   (cons 'font-size (+ fs increment )))))
 
     (interpret-markup layout (cons entries props) arg)))
-  
-
 
-;; FIXME -> should convert to font-size.
 (define-builtin-markup-command (magnify layout props sz arg) (number? markup?)
   "Set the font magnification for the its argument. In the following
 example, the middle A will be 10% larger:
@@ -863,7 +873,7 @@ Note: magnification only works if a font-name is explicitly selected.
 Use @code{\\fontsize} otherwise."
   (interpret-markup
    layout 
-   (prepend-alist-chain 'font-magnification sz props)
+   (prepend-alist-chain 'font-size (magnification->font-size sz) props)
    arg))
 
 (define-builtin-markup-command (bold layout props arg) (markup?)