X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fbackend-library.scm;h=ca1a16b7f6fddd60b71f708cab8cbb6a14c5d3e3;hb=6313f2575553aefbef5b98742a52b7dbe2d4a2a9;hp=45b156a6c8d84a67a46ef4159f7d5f158b78a5e6;hpb=8c00ef0a0eb95417f6db5056c0c03b7cfa2e7571;p=lilypond.git diff --git a/scm/backend-library.scm b/scm/backend-library.scm index 45b156a6c8..ca1a16b7f6 100644 --- a/scm/backend-library.scm +++ b/scm/backend-library.scm @@ -2,7 +2,7 @@ ;;;; ;;;; source file of the GNU LilyPond music typesetter ;;;; -;;;; (c) 2005--2007 Jan Nieuwenhuizen +;;;; (c) 2005--2009 Jan Nieuwenhuizen ;;;; Han-Wen Nienhuys ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -16,7 +16,9 @@ command (format #f "~a > ~a 2>&1 " command dev-null)))) (if (ly:get-option 'verbose) - (ly:message (_ "Invoking `~a'...") command)) + (begin + (ly:message (_ "Invoking `~a'...") command)) + (ly:progress "\n")) (set! status (if (pair? rest) @@ -71,24 +73,24 @@ (define-public (postscript->pdf paper-width paper-height name) (let* ((pdf-name (string-append - (basename (basename name ".ps") ".eps") + (dir-basename name ".ps" ".eps") ".pdf")) (is-eps (string-match "\\.eps$" name)) (paper-size-string (if is-eps - " -dEPSCrop " - (ly:format "-dDEVICEWIDTHPOINTS=~$ \ --dDEVICEHEIGHTPOINTS=~$ " - paper-width paper-height ))) + "-dEPSCrop" + (ly:format "-dDEVICEWIDTHPOINTS=~$\ + -dDEVICEHEIGHTPOINTS=~$" + paper-width paper-height))) (cmd (simple-format #f "~a\ ~a\ ~a\ ~a\ - -dCompatibilityLevel=1.4 \ + -dCompatibilityLevel=1.4\ -dNOPAUSE\ -dBATCH\ - -r1200 \ + -r1200\ -sDEVICE=pdfwrite\ -sOutputFile=~S\ -c .setpdfwrite\ @@ -98,9 +100,8 @@ (if (ly:get-option 'verbose) "" "-q") (if (or (ly:get-option 'gs-load-fonts) (ly:get-option 'gs-load-lily-fonts)) - - " -dNOSAFER " - " -dSAFER ") + "-dNOSAFER" + "-dSAFER") paper-size-string pdf-name name))) @@ -109,10 +110,9 @@ (if (eq? PLATFORM 'windows) (begin (set! cmd (string-regexp-substitute "=" "#" cmd)) - (set! cmd (string-regexp-substitute "-dSAFER " "" cmd)))) - - (if (access? pdf-name W_OK) - (delete-file pdf-name)) + (set! cmd (string-regexp-substitute "-dSAFER " "" cmd)) + (if (access? pdf-name W_OK) + (delete-file pdf-name)))) (ly:message (_ "Converting to `~a'...") pdf-name) (ly:progress "\n") @@ -121,12 +121,11 @@ (use-modules (scm ps-to-png)) (define-public (postscript->png resolution paper-width paper-height name) - ;; Do not try to guess the name of the png file, - ;; GS produces PNG files like BASE-page%d.png. - ;;(ly:message (_ "Converting to `~a'...") - ;; (string-append (basename name ".ps") "-page1.png" ))) (let* ((verbose (ly:get-option 'verbose)) (rename-page-1 #f)) + + ;; Do not try to guess the name of the png file, + ;; GS produces PNG files like BASE-page%d.png. (ly:message (_ "Converting to ~a...") "PNG") (make-ps-images name #:resolution resolution @@ -140,15 +139,15 @@ (define-public (postprocess-output paper-book module filename formats) (let* ((completed (completize-formats formats)) - (base (string-regexp-substitute "\\.[a-z]+$" "" filename)) + (base (dir-basename filename ".ps" ".eps")) (intermediate (remove (lambda (x) (member x formats)) completed))) - (for-each (lambda (f) ((eval (string->symbol (format "convert-to-~a" f)) module) paper-book filename)) completed) (if (ly:get-option 'delete-intermediate-files) (for-each (lambda (f) - (delete-file (string-append base "." f))) intermediate)))) + (if (file-exists? f) (delete-file f))) + (map (lambda (x) (string-append base "." x)) intermediate))))) (define-public (completize-formats formats) (define new-fmts '()) @@ -158,7 +157,7 @@ (set! formats (cons "ps" formats))) (for-each (lambda (x) (if (member x formats) (set! new-fmts (cons x new-fmts)))) - '("tex" "dvi" "ps" "pdf" "png")) + '("ps" "pdf" "png")) (uniq-list (reverse new-fmts))) (define (header-to-file file-name key value)