]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/framework-ps.scm
Issue 4889/2: Integrate Type1 font embedding procedures
[lilypond.git] / scm / framework-ps.scm
index d3234b332913e0fcbaade4d3b525dc7a21838711..9dc8414bbfe608e16d7871c40ee16a07bf611d05 100644 (file)
     (let* ((downcase-file-name (string-downcase file-name)))
       (cond
        ((and file-name (string-endswith downcase-file-name ".pfa"))
-        (embed-document file-name))
+        (ly:type1->pfa file-name))
        ((and file-name (string-endswith downcase-file-name ".pfb"))
-        (ly:pfb->pfa file-name))
+        (ly:type1->pfa file-name))
        ((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)
         ""))))
   (if (ly:get-option 'embed-source-code)
       (let ((source-list (delete-duplicates
                           (remove (lambda (str)
-                                    (string-contains str
-                                      (ly:get-option 'datadir)))
+                                    (or
+                                     (string-contains str
+                                       (ly:get-option 'datadir))
+                                     (string=? str
+                                       "<included string>")))
                             (ly:source-files)))))
          (display "\n/pdfmark where
 {pop} {userdict /pdfmark /cleartomark load put} ifelse" port)