summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasamichi Hosoda <trueroad@trueroad.jp>2016-06-18 22:49:44 +0900
committerMasamichi Hosoda <trueroad@trueroad.jp>2016-06-27 23:45:58 +0900
commit08d00bc3c27d182e2c59ccde7898a43fe03f81e4 (patch)
treed24c812a7e62082ed4e29f96315f16982ddd5c7d
parentd1c8e78eecd736dbc35469c7d6a6fca85fad9152 (diff)
Issue 4900: Improve `-dgs-load-fonts` option for non-zero font-index
`-dgs-load-fonts` loads fonts via Ghostscript. However, it could not load the font that has non-zero font-index. This commit lets it loads the font in a way that is not via Ghostscript.
-rw-r--r--scm/framework-ps.scm34
1 files changed, 22 insertions, 12 deletions
diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm
index fe7a925d71..ae63cb91e9 100644
--- a/scm/framework-ps.scm
+++ b/scm/framework-ps.scm
@@ -272,19 +272,29 @@
(let* ((font (car font-name-filename))
(name (cadr font-name-filename))
(file-name (caddr font-name-filename))
+ (font-index (cadddr font-name-filename))
(bare-file-name (ly:find-file file-name)))
- (cons name
- (if (mac-font? bare-file-name)
- (handle-mac-font name bare-file-name)
- (cond
- ((and font (cff-font? font))
- (ps-load-file (ly:find-file
- (format #f "~a.otf" file-name))))
- ((string? bare-file-name)
- (ps-load-file file-name))
- (else
- (ly:warning (_ "cannot embed ~S=~S") name file-name)
- ""))))))
+ (cond
+ ((and (number? font-index)
+ (!= font-index 0))
+ (ly:warning (_ "Font ~a cannot be loaded via Ghostscript because its font-index (~a) is not zero.")
+ name font-index)
+ (load-font font-name-filename))
+ ;; TODO: Check OTC fonts.
+ ;; TODO: Check TrueType fonts that do not have glyph names.
+ (else
+ (cons name
+ (if (mac-font? bare-file-name)
+ (handle-mac-font name bare-file-name)
+ (cond
+ ((and font (cff-font? font))
+ (ps-load-file (ly:find-file
+ (format #f "~a.otf" file-name))))
+ ((string? bare-file-name)
+ (ps-load-file file-name))
+ (else
+ (ly:warning (_ "cannot embed ~S=~S") name file-name)
+ ""))))))))
(define (dir-join a b)
(if (equal? a "")