+2005-06-10 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * scm/backend-library.scm (postscript->pdf):
+ * scm/ps-to-png.scm (make-ps-images): Do not use gs -q switch in
+ verbose mode. Search for several names of gs executable.
+
2005-06-10 Han-Wen Nienhuys <hanwen@xs4all.nl>
* lily/ly-module.cc (ly_make_anonymous_module): call make-module
PACKAGE_NAME=LilyPond
MAJOR_VERSION=2
MINOR_VERSION=5
-PATCH_LEVEL=30
+PATCH_LEVEL=29
MY_PATCH_LEVEL=
(regexp-substitute/global #f "[^- 0-9,.a-zA-Z'\"\\]" str 'pre 'post)
"\""))
+(define-public (search-executable names)
+ (define (helper path lst)
+ (if (null? (cdr lst))
+ (car lst)
+ (if (search-path path (car lst)) (car lst)
+ (helper path (cdr lst)))))
+
+ (let ((path (parse-path (getenv "PATH"))))
+ (helper path names)))
+
+(define-public (search-gs)
+ (search-executable '("gs-nox" "gs-8.15" "gs")))
+
(define-public (postscript->pdf papersizename name)
(let* ((pdf-name (string-append (basename name ".ps") ".pdf"))
(cmd (format #f
- "gs\
+ "~a\
+ ~a\
~a\
-dCompatibilityLevel=1.4 \
-sPAPERSIZE=~a\
- -q\
-dNOPAUSE\
-dBATCH\
-r1200 \
-c .setpdfwrite\
-f ~S\
"
+ (search-gs)
+ (if (ly:get-option 'verbose) "" "-q")
(if (ly:get-option 'gs-font-load)
" -dNOSAFER "
" -dSAFER ")
(define (re-sub re sub string)
(regexp-substitute/global #f re string 'pre sub 'post))
+(define (search-executable names)
+ (define (helper path lst)
+ (if (null? (cdr lst))
+ (car lst)
+ (if (search-path path (car lst)) (car lst)
+ (helper path (cdr lst)))))
+
+ (let ((path (parse-path (getenv "PATH"))))
+ (helper path names)))
+
+(define (search-gs)
+ (search-executable '("gs-nox" "gs-8.15" "gs")))
+
(define (gulp-port port max-length)
(let ((str (make-string max-length)))
(read-string!/partial str port)
;;png16m is because Lily produces color nowadays.
(cmd (if multi-page?
- (format #f "gs\
+ (format #f "~a\
+ ~a\
-dGraphicsAlphaBits=4\
-dNOPAUSE\
-dTextAlphaBits=4\
-sDEVICE=png16m\
-sOutputFile='~a'\
-sPAPERSIZE=~a\
- -q\
-r~S\
'~a'\
-c showpage\
-c quit" output-file paper-size resolution ps-name)
- (format #f "gs\
+ (format #f "~a\
+ ~a\
-s\
-dGraphicsAlphaBits=4\
-dEPSCrop\
-dTextAlphaBits=4\
-sDEVICE=png16m\
-sOutputFile='~a'\
- -q\
-r~S\
'~a'\
- -c quit" output-file resolution ps-name)))
+ -c quit"
+ (search-gs)
+ (if verbose? "" "-q")
+ output-file resolution ps-name)))
(foo (for-each delete-file (append (dir-re "." png1)
(dir-re "." pngn-re))))
(bar (if verbose?