(cond
((ly:music? cause) cause)
- ((ly:grob? cause) (music-cause cause))
+; ((ly:grob? cause) (music-cause cause))
(else
#f))))
((x-ext (ly:grob-extent grob grob X))
(y-ext (ly:grob-extent grob grob Y))
(x (car offset))
- (y (cdr offset))
- )
+ (y (cdr offset)))
+
+ (if (interval-empty? x-ext)
+ (set! x-ext '(0 . 0)))
- (map (lambda (x)
- (if (inf? x) 0.0 x))
-
- (list (+ x (car x-ext))
- (+ y (car y-ext))
- (+ x (cdr x-ext))
- (+ y (cdr y-ext)))
- )))
+ (if (interval-empty? y-ext)
+ (set! y-ext '(0 . 0)))
+
+ (list (+ x (car x-ext))
+ (+ y (car y-ext))
+ (+ x (cdr x-ext))
+ (+ y (cdr y-ext))
+ )))
(define-public (no-origin)
"nocause\n")
)))
+(define (escape-string str)
+ (string-regexp-substitute
+ " " "\\040"
+ (string-regexp-substitute "\"" "\\\"" str)))
+
(define-public (utf-8-string
descr
string)
- (format "utf-8 \"~a\" \"~a\"" descr
+ (format "utf-8 \"~a\" \"~a\""
+ (escape-string descr)
;; don't want unescaped spaces.
- (string-regexp-substitute " " "\\040"
- (string-regexp-substitute "\"" "\\\"" string))
+ (escape-string string)
))
+
+(define (bezier-sandwich lst thick)
+ (format
+ #f
+ "bezier_sandwich ~a [~a]"
+ thick
+ (string-append
+ (string-join (map (lambda (x) (format "(~a,~a)" (car x) (cdr x)))
+ lst) ","))))