From: Masamichi Hosoda Date: Mon, 30 May 2016 10:03:21 +0000 (+0900) Subject: Issue 4868/2: Add limited embedding support for OTC fonts X-Git-Tag: release/2.19.43-1~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=44802bfc4e5c3c03e675a83a5afe7ac99fb3b26d;p=lilypond.git 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. --- 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) ""))))