diff --git a/yg/ft2_debug.cpp b/yg/ft2_debug.cpp index 8fe68133e6..7d08c419b2 100644 --- a/yg/ft2_debug.cpp +++ b/yg/ft2_debug.cpp @@ -30,11 +30,12 @@ char const * FT_Error_Description(FT_Error error) return ft_errors[i].err_msg; } -void CheckError(FT_Error error) +void CheckError(FT_Error error, char const * msg) { if (error != 0) { - LOG(LINFO, ("FT_Error : ", FT_Error_Description(error))); + if (msg == 0) msg = ""; + LOG(LWARNING, ("FT_Error:", FT_Error_Description(error), msg)); } } diff --git a/yg/ft2_debug.hpp b/yg/ft2_debug.hpp index 8e3256c715..a813a19c96 100644 --- a/yg/ft2_debug.hpp +++ b/yg/ft2_debug.hpp @@ -12,8 +12,11 @@ namespace ft2_impl { - void CheckError(FT_Error error); + void CheckError(FT_Error error, char const * msg = 0); } #define FTCHECK(x) do { FT_Error e = (x); ft2_impl::CheckError(e); } while (false) -#define FTCHECKRETURN(x) do { FT_Error e = (x); if (e != 0) { ft2_impl::CheckError(e); return; } } while (false) +#define FTCHECKRETURN(x, msg) \ + do { FT_Error e = (x); \ + if (e != 0) { ft2_impl::CheckError(e, msg); return; } } \ + while (false) diff --git a/yg/glyph_cache_impl.cpp b/yg/glyph_cache_impl.cpp index 7f775e22a7..29ea339974 100644 --- a/yg/glyph_cache_impl.cpp +++ b/yg/glyph_cache_impl.cpp @@ -247,7 +247,7 @@ namespace yg // from routine, so add font to fonts array only in the end. FT_Face face; - FTCHECKRETURN(pFont->CreateFaceID(m_lib, &face)); + FTCHECKRETURN(pFont->CreateFaceID(m_lib, &face), fileName); vector charcodes; @@ -259,7 +259,7 @@ namespace yg sort(charcodes.begin(), charcodes.end()); charcodes.erase(unique(charcodes.begin(), charcodes.end()), charcodes.end()); - FTCHECKRETURN(FT_Done_Face(face)); + FTCHECKRETURN(FT_Done_Face(face), fileName); m_fonts.push_back(pFont);