;; 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
(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)))
;(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 ""))
(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:
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?)