diff options
author | Masamichi Hosoda <trueroad@trueroad.jp> | 2016-05-30 19:03:21 +0900 |
---|---|---|
committer | Masamichi Hosoda <trueroad@trueroad.jp> | 2016-06-06 22:49:04 +0900 |
commit | 44802bfc4e5c3c03e675a83a5afe7ac99fb3b26d (patch) | |
tree | 3eb4b8ac18921f685ef96c346a31de3311a28b7a /scm | |
parent | 8d1f238d09ada2152baebdfc949b7f56c2e7bfd6 (diff) |
Issue 4868/2: Add limited embedding support for OTC fonts
This commit adds limited embedding support
for OpenType/CFF Collection (OTC) fonts
which have `*.otc' filename extension.
Essentially, the extension of OTC font files should be `*.otc'.
However, most of the OTC fonts have the extension `*.ttc'
for backward compatibility.
https://www.microsoft.com/typography/otspec/recom.htm
So this is limited support
because most of the OTC fonts cannot be used.
TODO: distinguish files which have extension `*.ttc'
whether TrueType Collection (TTC) fonts or OTC fonts.
Diffstat (limited to 'scm')
-rw-r--r-- | scm/framework-ps.scm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index ca3372ca92..a781055f50 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -340,9 +340,15 @@ ((and file-name (string-endswith downcase-file-name ".ttf")) (ly:ttf->pfa file-name)) ((and file-name (string-endswith downcase-file-name ".ttc")) - (ly:ttf->pfa file-name font-index)) + ;; TODO: distinguish files which have extension `*.ttc' + ;; whether TrueType Collection (TTC) fonts + ;; or OpenType/CFF Collection (OTC) fonts. + (ly:ttf->pfa file-name font-index)) ;; TTC fonts ((and file-name (string-endswith downcase-file-name ".otf")) (ps-embed-cff (ly:otf->cff file-name) name 0)) + ((and file-name (string-endswith downcase-file-name ".otc")) + ;; The files which have the extension `*.otc' are OTC fonts. + (ps-embed-cff (ly:otf->cff file-name font-index) name 0)) ;; OTC fonts (else (ly:warning (_ "do not know how to embed ~S=~S") name file-name) "")))) |