diff options
author | Masamichi Hosoda <trueroad@trueroad.jp> | 2015-12-12 01:49:37 +0900 |
---|---|---|
committer | Masamichi Hosoda <trueroad@trueroad.jp> | 2015-12-28 20:55:56 +0900 |
commit | c8a49d69fa78ca3e6b0ce5feec76dcbd2e64b64d (patch) | |
tree | f1df0e6aa799c6c775c890e75876008d7520318e | |
parent | bb215c0308a2f94278f5be2fbc1b8c28d16550de (diff) |
Issue 4701/2: Fix `-dgs-load-lily-fonts' option
internal-font test by name is changed to the following:
CFF-font or not.
The font file exists in the LilyPond data directory or not.
-rw-r--r-- | scm/framework-ps.scm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index b45a69d615..f6d1700f42 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -246,10 +246,15 @@ footer))) (define (write-preamble paper load-fonts? port) - (define (internal-font? file-name) - (or (string-startswith file-name "Emmentaler") - (string-startswith file-name "emmentaler") - )) + (define (internal-font? font-name-filename) + (let* ((font (car font-name-filename)) + (file-name (caddr font-name-filename)) + (font-file-name (ly:find-file (format #f "~a.otf" file-name)))) + (and font + (cff-font? font) + font-file-name + (string-contains font-file-name + (ly:get-option 'datadir))))) (define (load-font-via-GS font-name-filename) (define (ps-load-file file-name) @@ -402,7 +407,7 @@ ((ly:get-option 'gs-load-lily-fonts) (if (or (string-contains (caddr name) (ly:get-option 'datadir)) - (internal-font? (caddr name))) + (internal-font? name)) (load-font-via-GS name) (load-font name))) (else |