;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
-;;;; (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
;;;; Jan Nieuwenhuizen <janneke@gnu.org>
;;; markup commands
(stack-lines -1 0.0 (chain-assoc-get 'baseline-skip props) cmols)))
(def-markup-command (vcenter layout props arg) (markup?)
- "Align @code{arg} to its center. "
+ "Align @code{arg} to its Y center. "
(let* ((mol (interpret-markup layout props arg)))
(ly:stencil-align-to! mol Y CENTER)
mol))
+(def-markup-command (hcenter layout props arg) (markup?)
+ "Align @code{arg} to its X center. "
+ (let* ((mol (interpret-markup layout props arg)))
+ (ly:stencil-align-to! mol X CENTER)
+ mol))
+
(def-markup-command (right-align layout props arg) (markup?)
"Align @var{arg} on its right edge. "
(let* ((m (interpret-markup layout props arg)))
(* -0.5 (chain-assoc-get 'baseline-skip props))
Y))
+(def-markup-command (beam layout props width slope thickness) (number? number? number?)
+ "Create a beam with the specified parameters."
+
+ (let*
+ ((y (* slope width))
+ (yext (cons (min 0 y) (max 0 y)))
+ (half (/ thickness 2)))
+
+ (ly:make-stencil
+ (list 'beam width
+ slope
+ thickness
+ (ly:output-def-lookup layout 'blotdiameter))
+ (cons 0 width)
+ (cons (+ (- half) (car yext))
+ (+ half (cdr yext))))
+
+ ))
+
+
(def-markup-command (normal-size-sub layout props arg) (markup?)
"Set @var{arg} in subscript, in a normal font size."
(ly:stencil-translate-axis
(def-markup-command larger (markup?) bigger-markup)
(def-markup-command (box layout props arg) (markup?)
- "Draw a box round @var{arg}. Looks at @code{thickness} and
-@code{box-padding} properties to determine line thickness and padding
-around the markup."
- (let ((th (chain-assoc-get 'thickness props 0.1))
- (pad (chain-assoc-get 'box-padding props 0.2))
- (m (interpret-markup layout props arg)))
+ "Draw a box round @var{arg}. Looks at @code{thickness},
+@code{box-padding} and @code{font-size} properties to determine line
+thickness and padding around the markup."
+ (let* ((th (chain-assoc-get 'thickness props 0.1))
+ (size (chain-assoc-get 'font-size props 0))
+ (pad
+ (* (magstep size)
+ (chain-assoc-get 'box-padding props 0.2)))
+ (m (interpret-markup layout props arg)))
(box-stencil m th pad)))
;;FIXME: is this working?
(define (stack-stencils stencils bskip last-stencil)
(cond
((null? stencils) '())
- ((not last-stencil)
+ ((not (ly:stencil? last-stencil))
(cons (car stencils)
(stack-stencils (cdr stencils) bskip (car stencils))))
(else
x)) args))
(leading
(chain-assoc-get 'baseline-skip props))
- (stacked (stack-stencils stencils 1.25 #f))
+ (stacked (stack-stencils
+ (remove ly:stencil-empty? stencils) 1.25 #f))
(brackets (make-brackets stacked indices '())))
(apply ly:stencil-add