From: Masamichi Hosoda Date: Sat, 25 Jun 2016 09:39:10 +0000 (+0900) Subject: Issue 4876/3: Enable fontname replacing in Pango_font class X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=de9831ffbac6592724492a21b084726e370bd362;p=lilypond.git Issue 4876/3: Enable fontname replacing in Pango_font class This commit enables fontname replacing for CFF (OTF/OTC) fonts. --- diff --git a/lily/pango-font.cc b/lily/pango-font.cc index 9e3a2d38b3..b805f34a85 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -41,6 +41,7 @@ #include "warn.hh" #include "all-font-metrics.hh" #include "program-option.hh" +#include "open-type-font.hh" #if HAVE_PANGO_FT2 #include "stencil.hh" @@ -200,7 +201,7 @@ Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item) const b.scale (scale_); - char const *ps_name_str0 = FT_Get_Postscript_Name (ftface); + const string ps_name_str0 = get_postscript_name (ftface); FcPattern *fcpat = fcfont->font_pattern; FcChar8 *file_name_as_ptr = 0; @@ -320,11 +321,11 @@ Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item) const Real size = pango_font_description_get_size (descr) / (Real (PANGO_SCALE)); - if (!ps_name_str0) + if (ps_name_str0.empty ()) warning (_f ("no PostScript font name for font `%s'", file_name)); string ps_name; - if (!ps_name_str0 + if (ps_name_str0.empty () && file_name != "" && (file_name.find (".otf") != NPOS || file_name.find (".cff") != NPOS)) @@ -351,7 +352,7 @@ Pango_font::pango_item_string_stencil (PangoGlyphItem const *glyph_item) const name = String_convert::to_lower (name); ps_name = initial + name; } - else if (ps_name_str0) + else if (!ps_name_str0.empty ()) ps_name = ps_name_str0; if (ps_name.length ())