]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 11 Dec 2004 16:55:05 +0000 (16:55 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 11 Dec 2004 16:55:05 +0000 (16:55 +0000)
lily/all-font-metrics.cc
lily/open-type-font.cc

index a73e22a2fc02f8e251b022ab8b2502014026baf7..bf2d36347130ed8683ba085f37f11c736f6df728 100644 (file)
@@ -206,8 +206,8 @@ All_font_metrics::find_font (String name)
   
   if (!f &&
       (name.left_string (4) == "feta"
-       || (name.left_string (8) == "parmesan")
-       || (name.left_string (2) == "lm")))
+       || name.left_string (8) == "parmesan"
+       || name.left_string (2) == "lm"))
     {
       f = find_afm (name);
       if (!f)
index b33031e04bb583fa8ab4c3894f15aeccdbbaa1b5..6c2d34aa4eaf3e5c66c79558ad2149e1459c905a 100644 (file)
 #include "warn.hh"
 #include "open-type-font.hh"
 
+#include <stdio.h>
+
+#if 0
+
+void
+enumerate_glyphs (FT_Face face)
+{
+  FT_UInt glyph_index;
+  FT_ULong char_code = FT_Get_First_Char (face, &glyph_index);
+  while (gindex != 0)                                       
+  {                                                                
+    // ... do something with (charcode,gindex) pair ...               
+    FT_Get
+    charcode = FT_Get_Next_Char( face, charcode, &gindex );        
+  }                                                                
+}
+
+#endif
+
 SCM
 Open_type_font::make_otf (String str)
 {
   Open_type_font * otf = new Open_type_font;
-  int error_code = FT_New_Face( freetype2_library, str.to_str0(),
-                      0, &(otf->face_));
+  int error_code = FT_New_Face(freetype2_library, str.to_str0(),
+                              0, &(otf->face_));
 
   //  int code = FT_Set_Charmap (otf->face_, );   
 
@@ -57,7 +76,13 @@ Open_type_font::get_indexed_char (int signed_idx)
 int
 Open_type_font::name_to_index (String nm)
 {
-  return 0;
+  FT_String * nm_str = nm.to_str0 ();
+  int idx = FT_Get_Name_Index (face_, nm_str);
+
+  if (idx == 0)
+    return -1;
+  else
+    return idx;
 }