("'" . ("'" . ()))
("empty" . (() . ()))
("brace" . (() . "brace"))
- ("bracket" . (() . "bracket"))))
+ ("bracket" . (() . "bracket"))
+
+ ;; segno bar lines
+ ("S" . ("||" . "S"))
+ ("|S" . ("|" . "S"))
+ ("S|" . ("S" . ()))
+ (":|S" . (":|" . "S"))
+ (":|S." . (":|S" . ()))
+ ("S|:" . ("S" . "|:"))
+ (".S|:" . ("|" . "S|:"))
+ (":|S|:" . (":|" . "S|:"))
+ (":|S.|:" . (":|S" . "|:"))))
(define-public (bar-line::calc-glyph-name grob)
(let* ((glyph (ly:grob-property grob 'glyph))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Color
-(define-public color? list?)
+(define-public (color? x)
+ (and (list? x)
+ (= 3 (length x))
+ (apply eq? #t (map number? x))
+ (apply eq? #t (map (lambda (y) (<= 0 y 1)) x))))
+
(define-public (rgb-color r g b) (list r g b))
; predefined colors
(list lp rp)))
(define-public (parentheses-item::calc-angled-bracket-stencils grob)
- (let* ((font (ly:grob-default-font grob))
- (lp (ly:stencil-aligned-to (ly:stencil-aligned-to
- (grob-interpret-markup
- grob
- (ly:wide-char->utf-8 #x2329))
- Y CENTER)
- X RIGHT))
- (rp (ly:stencil-aligned-to (ly:stencil-aligned-to
- (grob-interpret-markup
- grob
- (ly:wide-char->utf-8 #x232A))
- Y CENTER)
- X LEFT)))
-
+ (let* ((parent (ly:grob-parent grob Y))
+ (y-extent (ly:grob-extent parent parent Y))
+ (half-thickness 0.05) ; should it be a property?
+ (width 0.5) ; should it be a property?
+ (angularity 1.5) ; makes angle brackets
+ (white-padding 0.1) ; should it be a property?
+ (lp (ly:stencil-aligned-to
+ (ly:stencil-aligned-to
+ (make-parenthesis-stencil y-extent
+ half-thickness
+ (- width)
+ angularity)
+ Y CENTER)
+ X RIGHT))
+ (lp-x-extent
+ (interval-widen (ly:stencil-extent lp X) white-padding))
+ (rp (ly:stencil-aligned-to
+ (ly:stencil-aligned-to
+ (make-parenthesis-stencil y-extent
+ half-thickness
+ width
+ angularity)
+ Y CENTER)
+ X LEFT))
+ (rp-x-extent
+ (interval-widen (ly:stencil-extent rp X) white-padding)))
+ (set! lp (ly:make-stencil (ly:stencil-expr lp)
+ lp-x-extent
+ (ly:stencil-extent lp Y)))
+ (set! rp (ly:make-stencil (ly:stencil-expr rp)
+ rp-x-extent
+ (ly:stencil-extent rp Y)))
(list (stencil-whiteout lp)
- (stencil-whiteout rp))))
+ (stencil-whiteout rp))))
(define (parenthesize-elements grob . rest)
(let* ((refp (if (null? rest)
(begin
(ly:grob-suicide! grob)
(list)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; laissez-vibrer tie
+;;
+;; needed so we can make laissez-vibrer a pure print
+;;
+(define-public (laissez-vibrer::print grob)
+ (ly:tie::print grob))
+