;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
-;;;; (c) 2003--2006 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+;;;; (c) 2003--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
(define-public (stack-stencils axis dir padding stils)
"Stack stencils STILS in direction AXIS, DIR, using PADDING."
(y-ext (ly:stencil-extent stencil 1))
(diameter (max (- (cdr x-ext) (car x-ext))
(- (cdr y-ext) (car y-ext))))
- (radius (+ (/ diameter 2) padding thickness)))
+ (radius (+ (/ diameter 2) padding thickness))
+ (circle (make-circle-stencil radius thickness #f)))
+
(ly:stencil-add
- (centered-stencil stencil) (make-circle-stencil radius thickness #f))))
+ stencil
+ (ly:stencil-translate circle
+ (cons
+ (interval-center x-ext)
+ (interval-center y-ext))))))
+
(define-public (fontify-text font-metric text)
"Set TEXT with font FONT-METRIC, returning a stencil."
(write-system-signatures basename (cdr paper-systems) (1+ count))))))
+(use-modules (scm paper-system))
(define-public (write-system-signature filename paper-system)
(define (float? x)
(and (number? x) (inexact? x)))
rest))
expr))
- (define (music-cause grob)
- (let*
- ((cause (ly:grob-property grob 'cause)))
-
- (cond
- ((ly:music? cause) cause)
- ((ly:grob? cause) (music-cause cause))
- (else #f))))
(define (pythonic-string expr)
"escape quotes and slashes for python consumption"
(define (pythonic-pair expr)
(format "(~a,~a)"
(car expr) (cdr expr)))
-
+
+
+ (define (raw-string expr)
+ "escape quotes and slashes for python consumption"
+ (regexp-substitute/global #f "[@\n]" (format "~a" expr) 'pre " " 'post))
+
+ (define (raw-pair expr)
+ (format "~a ~a"
+ (car expr) (cdr expr)))
+
(define (found-grob expr)
(let*
((grob (car expr))
(rest (cdr expr))
(collected '())
- (cause (music-cause grob))
- (input (if (ly:music? cause) (ly:music-property cause 'origin) #f))
+ (cause (event-cause grob))
+ (input (if (ly:stream-event? cause) (ly:event-property cause 'origin) #f))
(location (if (ly:input-location? input) (ly:input-file-line-char-column input) '()))
(x-ext (ly:grob-extent grob system-grob X))
rest)
(format output
- "['~a', '~a', ~a, ~a, '~a'],\n"
+ "~a@~a@~a@~a@~a\n"
(cdr (assq 'name (ly:grob-property grob 'meta) ))
- (pythonic-string location)
- (pythonic-pair (if (interval-empty? x-ext) '(1 . -1) x-ext))
- (pythonic-pair (if (interval-empty? y-ext) '(1 . -1) y-ext))
- (pythonic-string collected))
+ (raw-string location)
+ (raw-pair (if (interval-empty? x-ext) '(1 . -1) x-ext))
+ (raw-pair (if (interval-empty? y-ext) '(1 . -1) y-ext))
+ (raw-string collected))
))
(define (interpret-for-signature escape collect expr)