]> git.donarmstrong.com Git - lilypond.git/commitdiff
handle CID CFFs.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 20 May 2005 18:09:02 +0000 (18:09 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 20 May 2005 18:09:02 +0000 (18:09 +0000)
ChangeLog
lily/pango-font.cc
scm/framework-ps.scm
scm/output-ps.scm

index 72131e75f66cc6c49add879cbc7e623f6d837af4..0cf52a5ee8926117c189aa521113f7ebf84f6ed3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,9 @@
 
 2005-05-20  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * scm/output-ps.scm (glyph-string): take cid? argument. Use
+       findresource iso. findfont for CID CFF fonts.
+
        * VERSION (PACKAGE_NAME): release 2.5.25
 
        * ly/Welcome_to_LilyPond.ly: add  \version
index b8693c8b735096e88fc36eabc4f287b3a26376ea..c0218074672d459ae8fd0731a440d01732a158db 100644 (file)
@@ -101,9 +101,11 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con
                   PANGO_ASCENT (ink_rect)));
 
   b.scale (scale_);
-
+  
   SCM glyph_exprs = SCM_EOL;
   SCM *tail = &glyph_exprs;
+
+  bool cid_keyed = false;
   for (int i = 0; i < pgs->num_glyphs; i++)
     {
       PangoGlyphInfo *pgi = pgs->glyphs + i;
@@ -120,6 +122,7 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con
          /*
            CID entry
           */
+         cid_keyed = true;
          char_id = scm_from_int (pg);
        }
       else
@@ -183,9 +186,10 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con
       ((Pango_font *) this)->register_font_file (file_name, ps_name);
       pango_fc_font_unlock_face (fcfont);
        
-      SCM expr = scm_list_4 (ly_symbol2scm ("glyph-string"),
+      SCM expr = scm_list_5 (ly_symbol2scm ("glyph-string"),
                             scm_makfrom0str (ps_name.to_str0 ()),
                             scm_from_double (size),
+                            scm_from_bool (cid_keyed),
                             ly_quote_scm (glyph_exprs));
 
       return Stencil (b, expr);
index 2731193c6043f6c427510cba1544d5b1f9d2e8c8..c80168fdd9406e51b45c065610e56c1787d07bed 100644 (file)
     (let* ((font (car font-name-filename))
           (name (cadr font-name-filename))
           (file-name (caddr font-name-filename))
-          (bare-file-name (ly:find-file file-name)))
+          (bare-file-name (ly:find-file file-name))
+          )
 
       (cons
        (munge-lily-font-name name)
                    (list #f
                          (car name-psname-pair)
                          (cdr name-psname-pair)))
-                  (ly:pango-font-physical-fonts font)))
+                 (ly:pango-font-physical-fonts font)))
+
                (else
                 (ly:font-sub-fonts font))))
 
index cc021b84234809fdaaae12fb4e0666b5a0bd9e94..538bd18c8eb484f2f4d07039aded18aa52ba875d 100644 (file)
 
 (define (glyph-string
         postscript-font-name
-        size
+        size cid?
         x-y-named-glyphs)
+  
   (format #f "gsave 1 output-scale div 1 output-scale div scale
-  /~a findfont ~a scalefont setfont\n~a grestore" postscript-font-name size
-  (apply
-   string-append
-   (map (lambda  (item)
-         (let
-             ((x (car item))
-               (y (cadr item))
-               (g (caddr item)))
-
-           (if (and (= 0.0 x)
-                    (= 0.0 y))
-               (format #f " /~a glyphshow\n" g)
-               (format #f " ~a ~a rmoveto ~a~a glyphshow\n"
-                       x y
-                       (if  (string? g) "/" "")
-                       g))))
-       x-y-named-glyphs))))
+  /~a ~a ~a scalefont setfont\n~a grestore"
+         postscript-font-name
+         (if cid?
+             " /CIDFont findresource "
+             " findfont") 
+         
+         size
+         (apply
+          string-append
+          (map (lambda  (item)
+                 (let
+                     ((x (car item))
+                      (y (cadr item))
+                      (g (caddr item)))
+
+                   (if (and (= 0.0 x)
+                            (= 0.0 y))
+                       (format #f " /~a glyphshow\n" g)
+                       (format #f " ~a ~a rmoveto ~a~a glyphshow\n"
+                               x y
+                               (if  (string? g) "/" "")
+                               g))))
+               x-y-named-glyphs))))
 
 (define (grob-cause offset grob)
   (let* ((cause (ly:grob-property grob 'cause))