From: Han-Wen Nienhuys Date: Sat, 11 Dec 2004 16:55:05 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.5.14~450 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4173d6daa376784cd64637a09ebab0d96c25292e;p=lilypond.git *** empty log message *** --- diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index a73e22a2fc..bf2d363471 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -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) diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index b33031e04b..6c2d34aa4e 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -10,12 +10,31 @@ #include "warn.hh" #include "open-type-font.hh" +#include + +#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; }