This commit enables fontname replacing for CFF (OTF/OTC) fonts.
#include "warn.hh"
#include "all-font-metrics.hh"
#include "program-option.hh"
#include "warn.hh"
#include "all-font-metrics.hh"
#include "program-option.hh"
+#include "open-type-font.hh"
#if HAVE_PANGO_FT2
#include "stencil.hh"
#if HAVE_PANGO_FT2
#include "stencil.hh"
- 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;
FcPattern *fcpat = fcfont->font_pattern;
FcChar8 *file_name_as_ptr = 0;
Real size = pango_font_description_get_size (descr)
/ (Real (PANGO_SCALE));
Real size = pango_font_description_get_size (descr)
/ (Real (PANGO_SCALE));
+ if (ps_name_str0.empty ())
warning (_f ("no PostScript font name for font `%s'", file_name));
string ps_name;
warning (_f ("no PostScript font name for font `%s'", file_name));
string ps_name;
+ if (ps_name_str0.empty ()
&& file_name != ""
&& (file_name.find (".otf") != NPOS
|| file_name.find (".cff") != NPOS))
&& file_name != ""
&& (file_name.find (".otf") != NPOS
|| file_name.find (".cff") != NPOS))
name = String_convert::to_lower (name);
ps_name = initial + name;
}
name = String_convert::to_lower (name);
ps_name = initial + name;
}
+ else if (!ps_name_str0.empty ())
ps_name = ps_name_str0;
if (ps_name.length ())
ps_name = ps_name_str0;
if (ps_name.length ())