CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/05/20 18:09:02

Modified files:
        .              : ChangeLog 
        lily           : pango-font.cc 
        scm            : framework-ps.scm output-ps.scm 

Log message:
        handle CID CFFs.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3644&tr2=1.3645&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/pango-font.cc.diff?tr1=1.34&tr2=1.35&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/framework-ps.scm.diff?tr1=1.106&tr2=1.107&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/output-ps.scm.diff?tr1=1.138&tr2=1.139&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3644 lilypond/ChangeLog:1.3645
--- lilypond/ChangeLog:1.3644   Fri May 20 11:42:12 2005
+++ lilypond/ChangeLog  Fri May 20 18:09:02 2005
@@ -6,6 +6,9 @@
 
 2005-05-20  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
+       * 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: lilypond/lily/pango-font.cc
diff -u lilypond/lily/pango-font.cc:1.34 lilypond/lily/pango-font.cc:1.35
--- lilypond/lily/pango-font.cc:1.34    Sun May 15 23:44:06 2005
+++ lilypond/lily/pango-font.cc Fri May 20 18:09:02 2005
@@ -101,9 +101,11 @@
                   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 @@
          /*
            CID entry
           */
+         cid_keyed = true;
          char_id = scm_from_int (pg);
        }
       else
@@ -183,9 +186,10 @@
       ((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: lilypond/scm/framework-ps.scm
diff -u lilypond/scm/framework-ps.scm:1.106 lilypond/scm/framework-ps.scm:1.107
--- lilypond/scm/framework-ps.scm:1.106 Sun May 15 23:44:06 2005
+++ lilypond/scm/framework-ps.scm       Fri May 20 18:09:02 2005
@@ -254,7 +254,8 @@
     (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)
@@ -301,7 +302,8 @@
                    (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: lilypond/scm/output-ps.scm
diff -u lilypond/scm/output-ps.scm:1.138 lilypond/scm/output-ps.scm:1.139
--- lilypond/scm/output-ps.scm:1.138    Sat May 14 21:43:04 2005
+++ lilypond/scm/output-ps.scm  Fri May 20 18:09:02 2005
@@ -174,26 +174,33 @@
 
 (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))


_______________________________________________
Lilypond-cvs mailing list
Lilypond-cvs@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to