From a03c53cb8d65969f410a6ad5e0c6376946ac7a73 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 3 Jun 2007 22:15:50 -0300 Subject: [PATCH] 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. --- scm/framework-ps.scm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) 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) -- 2.39.5