From 333750a965c5778ba60cf2ecf5ed8d0ca231933e Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 23 Dec 2008 14:37:17 +0100 Subject: [PATCH] open_ft_face now handles font index. --- lily/include/open-type-font.hh | 2 +- lily/open-type-font.cc | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lily/include/open-type-font.hh b/lily/include/open-type-font.hh index f79e4c07ba..8c85ea5efc 100644 --- a/lily/include/open-type-font.hh +++ b/lily/include/open-type-font.hh @@ -52,7 +52,7 @@ public: }; string get_otf_table (FT_Face face, string tag); -FT_Face open_ft_face (string str); +FT_Face open_ft_face (string str, FT_Long idx = 0); #endif /* OPEN_TYPE_FONT_HH */ diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 97c49feca2..3bd52480a1 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -91,18 +91,17 @@ get_otf_table (FT_Face face, string tag) } FT_Face -open_ft_face (string str) +open_ft_face (string str, FT_Long idx) { FT_Face face; - int error_code = FT_New_Face (freetype2_library, str.c_str (), 0, &face); + int error_code = FT_New_Face (freetype2_library, str.c_str (), idx, &face); if (error_code == FT_Err_Unknown_File_Format) error (_f ("unsupported font format: %s", str.c_str ())); else if (error_code) error (_f ("error reading font file %s: %s", str.c_str (), - freetype_error_string (error_code).c_str () - )); + freetype_error_string (error_code).c_str ())); return face; } -- 2.39.2