]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/ttf.cc
(get_paper_systems): uniq all_elements_ , to
[lilypond.git] / lily / ttf.cc
index 8fc2c148bd70124ccf2414451ddacbb06cab6fbd..9f5fbfb8a29a408fe75d8c380a839900c5854e62 100644 (file)
@@ -153,6 +153,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;
@@ -161,19 +162,25 @@ print_trailer (void *out,
          FT_Error error = FT_Get_Glyph_Name (face, i, glyph_name,
                                              GLYPH_NAME_LEN);
          if (error)
-           programming_error ("print_trailer(): FT_Get_Glyph_Name() returned error");
-         else
-           glyph_name[0] = 0;
+           {
+             programming_error ("print_trailer(): FT_Get_Glyph_Name() returned error");
+             glyph_name[0] = 0;
+           }
        }
 
-      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");
     }