From: Han-Wen Nienhuys Date: Mon, 4 Jun 2007 01:15:50 +0000 (-0300) Subject: output lily font filename with lilypond-datadir as a variable. X-Git-Tag: release/2.11.26-1~17 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a03c53cb8d65969f410a6ad5e0c6376946ac7a73;p=lilypond.git output lily font filename with lilypond-datadir as a variable. This will help testing. With this we can package the datadir together with the test result, and test and visualize across font changes. --- diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index a119024a1d..0eb622fe48 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -251,12 +251,14 @@ (define (write-preamble paper load-fonts? port) (define (load-font-via-GS font-name-filename) - (define (ps-load-file name) - (format - (if (string? name) - "(~a) (r) file .loadfont\n" - "% cannot find font file: ~a\n") - name)) + (define (ps-load-file file-name) + (if (string? file-name) + (if (string-contains file-name (ly:get-option 'datadir)) + (begin + (set! file-name (ly:string-substitute (ly:get-option 'datadir) "" file-name)) + (format "lilypond-datadir (~a) concatstrings (r) file .loadfont" file-name)) + (format "(~a) (r) file .loadfont\n" file-name)) + (format "% cannot find font file: ~a\n" file-name))) (let* ((font (car font-name-filename)) (name (cadr font-name-filename)) @@ -419,6 +421,11 @@ pfas)) (display "%%BeginProlog\n" port) + + (format port + "/lilypond-datadir where {pop} {userdict /lilypond-datadir (~a) put } ifelse" + (ly:get-option 'datadir)) + (if load-fonts? (for-each (lambda (f)