+(define (grob-bbox grob offset)
+ (let*
+ ((x-ext (ly:grob-extent grob grob X))
+ (y-ext (ly:grob-extent grob grob Y))
+ (x (car offset))
+ (y (cdr offset)))
+
+ (if (interval-empty? x-ext)
+ (set! x-ext '(0 . 0)))
+
+ (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 (escape-string str)
+ (string-regexp-substitute
+ " " "\\040"
+ (string-regexp-substitute "\"" "\\\"" str)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; stencil commands
+;;;
+
+(define (bezier-sandwich lst thick)
+ (format "bezier_sandwich ~a [~a]"
+ thick
+ (string-append
+ (string-join (map
+ (lambda (x)
+ (format "(~a,~a)" (car x) (cdr x)))
+ lst)
+ ","))))
+
+(define (draw-line thick x1 y1 x2 y2)