summaryrefslogtreecommitdiff
path: root/scm
diff options
context:
space:
mode:
authorMasamichi Hosoda <trueroad@trueroad.jp>2016-06-19 21:54:46 +0900
committerMasamichi Hosoda <trueroad@trueroad.jp>2016-06-27 23:45:58 +0900
commitb060b5bac8cb49ab80f6ea31410725340423e6f7 (patch)
tree121d3c680f6542d92baec89769e1da270c6b28ae /scm
parent9437884ac32029c7166ab54cb4f727232b7cdc3c (diff)
Issue 4902/2: Improve `-dgs-load-fonts` option for TTF
`-dgs-load-fonts` loads fonts via Ghostscript. However, if a TrueType font (TTF) that does not have glyph names is loaded via Ghostscript, all characters are shown in TOFU. This commit lets `-dgs-load-fonts` loads those fonts in a way that is not via Ghostscript.
Diffstat (limited to 'scm')
-rw-r--r--scm/framework-ps.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm
index 42b60b4042..36c4dda9cb 100644
--- a/scm/framework-ps.scm
+++ b/scm/framework-ps.scm
@@ -298,7 +298,12 @@
(ly:warning (_ "Font ~a cannot be loaded via Ghostscript because it is an OpenType/CFF (OTC) font.")
name)
(load-font font-name-filename))
- ;; TODO: Check TrueType fonts that do not have glyph names.
+ ((and (string? bare-file-name)
+ (eq? (ly:get-font-format bare-file-name font-index) 'TrueType)
+ (not (ly:has-glyph-names? bare-file-name font-index)))
+ (ly:warning (_ "Font ~a cannot be used via Ghostscript because it is a TrueType font that does not have glyph names.")
+ name)
+ (load-font font-name-filename))
(else
(cons name
(if (mac-font? bare-file-name)