]> git.donarmstrong.com Git - lilypond.git/commitdiff
(print_trailer): only print existing glyphs.
authorhanwen <hanwen>
Thu, 30 Mar 2006 10:48:18 +0000 (10:48 +0000)
committerhanwen <hanwen>
Thu, 30 Mar 2006 10:48:18 +0000 (10:48 +0000)
ChangeLog
lily/ttf.cc

index f00b59cb4eae39d0045829a2a0102a7ffe31675b..8749767bb3cc10547b286acfaf27df64342576ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-03-30  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * lily/ttf.cc (print_trailer): only print existing glyphs. 
+
 2006-03-30  Joe Neeman  <joeneeman@gmail.com>
 
        * lily/stem-tremolo.cc (print): for whole notes (and breves, etc.)
index bdd4eda88da361726a2e4ec990018f0b5111ca0a..6d3b400e58113cfe46c32f600e8d05971c3b857f 100644 (file)
@@ -139,6 +139,7 @@ print_body (void *out, string name)
   fclose (fd);
 }
 
+
 static void
 print_trailer (void *out,
               FT_Face face)
@@ -153,6 +154,7 @@ print_trailer (void *out,
 
   Index_to_charcode_map ic_map (make_index_to_charcode_map (face));
 
+  int output_count = 0;
   for (int i = 0; i < mp->numGlyphs; i++)
     {
       glyph_name[0] = 0;
@@ -167,14 +169,19 @@ print_trailer (void *out,
            }
        }
 
-      if (!glyph_name[0])
+      if (!glyph_name[0] && ic_map.find (i) != ic_map.end ())
        {
-         get_unicode_name (glyph_name, ic_map[i]);
+         FT_ULong ucode = ic_map[i];
+         get_unicode_name (glyph_name, ucode);
        }
-      
-      lily_cookie_fprintf (out, "/%s %d def ", glyph_name, i);
 
-      if (! (i % 5))
+      if (glyph_name[0])
+       {
+         lily_cookie_fprintf (out, "/%s %d def ", glyph_name, i);
+         output_count ++;
+       }
+      
+      if (! (output_count % 5))
        lily_cookie_fprintf (out, "\n");
     }