X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdefine-markup-commands.scm;h=42ce759bb7c31cea59d90456db7e45c97d933511;hb=76b9a727b454dc2c7d30212f787913b71d756b4c;hp=45833f08e0abf7e41cb01c8a31c3a1edaa704948;hpb=e9a308e9c6002900fc336733950a0175bcbcc333;p=lilypond.git diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 45833f08e0..42ce759bb7 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -24,6 +24,23 @@ ;; 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 ""))