From 1f3a3c18f8914a996be5af986d8c6f7e022d4ea3 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Tue, 23 Jan 2007 02:41:04 +0100 Subject: [PATCH] use freetype_error_string in more places. --- lily/open-type-font.cc | 10 +++++++--- lily/pango-font.cc | 4 +++- lily/ttf.cc | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index d4ed2cfee8..2e72d57af3 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -39,7 +39,9 @@ load_table (char const *tag_str, FT_Face face, FT_ULong *length) return buffer; } else - programming_error ("Cannot find OpenType table."); + programming_error (_f ("Free type error: %s", + freetype_error_string (error_code).c_str () + )); return 0; } @@ -172,7 +174,8 @@ Open_type_font::get_indexed_char (size_t signed_idx) const char name[len]; size_t code = FT_Get_Glyph_Name (face_, signed_idx, name, len); if (code) - warning (_f ("FT_Get_Glyph_Name() returned error: %u", unsigned (code))); + warning (_f ("FT_Get_Glyph_Name() Freetype error: %s", + freetype_error_string (code))); SCM sym = ly_symbol2scm (name); SCM alist = scm_hashq_ref (lily_character_table_, sym, SCM_BOOL_F); @@ -296,7 +299,8 @@ Open_type_font::glyph_list () const char name[len]; size_t code = FT_Get_Glyph_Name (face_, i, name, len); if (code) - warning (_f ("FT_Get_Glyph_Name() returned error: %u", unsigned (code))); + warning (_f ("FT_Get_Glyph_Name() error: %s", + freetype_error_string (code).c_str ())); *tail = scm_cons (scm_from_locale_string (name), SCM_EOL); tail = SCM_CDRLOC (*tail); diff --git a/lily/pango-font.cc b/lily/pango-font.cc index f91eafb984..10cca5bfaf 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -163,7 +163,9 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str, { int errorcode = FT_Get_Glyph_Name (ftface, pg, glyph_name, GLYPH_NAME_LEN); if (errorcode) - programming_error ("FT_Get_Glyph_Name returns error"); + programming_error (_f ("FT_Get_Glyph_Name() error: %s", + freetype_error_string (errorcode).c_str() + )); } SCM char_id = SCM_EOL; diff --git a/lily/ttf.cc b/lily/ttf.cc index e8e86007a3..26deb0841b 100644 --- a/lily/ttf.cc +++ b/lily/ttf.cc @@ -168,7 +168,7 @@ print_trailer (void *out, GLYPH_NAME_LEN); if (error) { - programming_error ("print_trailer(): FT_Get_Glyph_Name() returned error"); + programming_error ("FT_Get_Glyph_Name(): error."); glyph_name[0] = 0; } } -- 2.39.2