]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/framework-ps.scm
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / scm / framework-ps.scm
index a5fd02fb1c21136449ea8aaa480b7c00cf84c479..0eb622fe48d56d184ab341e28ee429d3e40ff055 100644 (file)
 (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))
       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)
   (ly:error (_ "\nThe PostScript backend does not support the system-by-system 
 output. For that, use the EPS backend instead,
 
-  lilypond -b eps <file>
+  lilypond -b eps FILE
 
 If have cut & pasted a lilypond fragment from a webpage, be sure
 to only remove anything before
@@ -768,5 +775,4 @@ to only remove anything before
   %% ****************************************************************
   %% Start cut-&-pastable-section
   %% ****************************************************************
-
 ")))