-
- ;; main body
- (let* ((tex-system-name (format "~a-systems.tex" basename))
- (texi-system-name (format "~a-systems.texi" basename))
- (tex-system-port (open-output-file tex-system-name))
- (texi-system-port (open-output-file texi-system-name)))
-
- (ly:message (_ "Writing ~a...") tex-system-name)
- (ly:message (_ "Writing ~a...") texi-system-name)
-
- (set! stencils (widen-left-stencil-edges stencils))
-
- (dump-stencils-as-separate-EPS stencils 1)
+ ;; main body
+ (let* ((write-file (lambda (str-port ext)
+ (let* ((name (format "~a-systems.~a" basename ext))
+ (port (open-output-file name)))
+ (ly:message (_ "Writing ~a...") name)
+ (display (get-output-string str-port) port)
+ (close-output-port port))))
+ (tex-system-port (open-output-string))
+ (texi-system-port (open-output-string))
+ (count-system-port (open-output-string))
+ (widened-stencils (widen-left-stencil-edges stencils))
+ (counted-systems (count-list widened-stencils))
+ (eps-files (map dump-counted-stencil counted-systems)))
+ (if do-pdf
+ ;; par-for-each: a bit faster ...
+ (for-each (lambda (y)
+ (postscript->pdf 0 0 y))
+ eps-files))