]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 4868/2: Add limited embedding support for OTC fonts
authorMasamichi Hosoda <trueroad@trueroad.jp>
Mon, 30 May 2016 10:03:21 +0000 (19:03 +0900)
committerMasamichi Hosoda <trueroad@trueroad.jp>
Mon, 6 Jun 2016 13:49:04 +0000 (22:49 +0900)
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.

scm/framework-ps.scm

index ca3372ca92557b2d32129ea705f692f2e8977be0..a781055f5077d152520e7d7c4643341a9fc5ea0f 100644 (file)
        ((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)
         ""))))