summaryrefslogtreecommitdiff
path: root/lily
diff options
context:
space:
mode:
authorMasamichi Hosoda <trueroad@trueroad.jp>2016-06-25 18:39:10 +0900
committerMasamichi Hosoda <trueroad@trueroad.jp>2016-07-04 21:46:34 +0900
commitde9831ffbac6592724492a21b084726e370bd362 (patch)
tree3776782b9dc71f964dcbdaa7aab06f09956adbb9 /lily
parent3c2fbb63c2b588dc244197ab7de7f028807833bb (diff)
Issue 4876/3: Enable fontname replacing in Pango_font class
This commit enables fontname replacing for CFF (OTF/OTC) fonts.
Diffstat (limited to 'lily')
-rw-r--r--lily/pango-font.cc9
1 files changed, 5 insertions, 4 deletions
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 ())