X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fframework-ps.scm;h=7c5669fdb32ecd11b80ded4d137994e30ddfb81c;hb=e39795fe363e99c13dca90db0a7d289343ec6dd2;hp=28579ebc96f93c0175d793fa39d8dd2547741cfb;hpb=c5a3f0c024f4cb629811cff9eb04abff36e94138;p=lilypond.git diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 28579ebc96..7c5669fdb3 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -17,10 +17,7 @@ (scm clip-region) (lily)) -(define (format dest . rest) - (if (string? dest) - (apply simple-format (cons #f (cons dest rest))) - (apply simple-format (cons dest rest)))) +(define format ergonomic-simple-format) (define framework-ps-module (current-module)) @@ -251,12 +248,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 +418,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) @@ -433,9 +437,6 @@ (display (procset "music-drawing-routines.ps") port) (display (procset "lilyponddefs.ps") port) - (if (not (ly:get-option 'point-and-click)) - (display "/mark_URI { pop pop pop pop pop } bind def\n" port)) - (display "%%EndProlog\n" port) (display "%%BeginSetup\ninit-lilypond-parameters\n%%EndSetup\n\n" port)) @@ -447,7 +448,7 @@ ;; content-mangling is always bad. ;; MINGW hack: need to have "b"inary for embedding CFFs (open-file filename "wb") - "ps")) + 'ps)) (paper (ly:paper-book-paper book)) (systems (ly:paper-book-systems book)) (page-stencils (map page-stencil (ly:paper-book-pages book))) @@ -539,7 +540,7 @@ ;; content-mangling is always bad. ;; MINGW hack: need to have "b"inary for embedding CFFs (open-file (format "~a.eps" filename) "wb") - "ps")) + 'ps)) (port (ly:outputter-port outputter)) (rounded-bbox (to-bp-box bbox)) @@ -763,7 +764,7 @@ (ly:error (_ "\nThe PostScript backend does not support the system-by-system output. For that, use the EPS backend instead, - lilypond -b eps + lilypond -dbackend=eps FILE If have cut & pasted a lilypond fragment from a webpage, be sure to only remove anything before @@ -771,5 +772,4 @@ to only remove anything before %% **************************************************************** %% Start cut-&-pastable-section %% **************************************************************** - ")))