summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-08-23 21:17:59 +0100
committerCarl Hetherington <cth@carlh.net>2015-08-23 21:17:59 +0100
commit75099ca16c75749af29ec45c9d1bde0f78dfd409 (patch)
tree286b74ff77fb51ca378ab0b4a35a89687779f7db /src
parent0c75dbf259d13e459de0caeae22ec6f67e7d8176 (diff)
FontConfig debugging.
Diffstat (limited to 'src')
-rw-r--r--src/lib/render_subtitles.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/render_subtitles.cc b/src/lib/render_subtitles.cc
index e29d0c75e..e2e5745cf 100644
--- a/src/lib/render_subtitles.cc
+++ b/src/lib/render_subtitles.cc
@@ -32,10 +32,13 @@ using std::string;
using std::min;
using std::max;
using std::pair;
+using std::cerr;
using std::make_pair;
using boost::shared_ptr;
using boost::optional;
+#define DEBUG_FONTS 1
+
static FcConfig* fc_config = 0;
static list<pair<boost::filesystem::path, string> > fc_config_fonts;
@@ -102,7 +105,11 @@ render_subtitle (dcp::SubtitleString const & subtitle, list<shared_ptr<Font> > f
font_name = existing->second;
} else {
/* Make this font available to DCP-o-matic */
- FcConfigAppFontAddFile (fc_config, reinterpret_cast<FcChar8 const *> (font_file.string().c_str ()));
+ if (FcConfigAppFontAddFile (fc_config, reinterpret_cast<FcChar8 const *> (font_file.string().c_str ())) == FcFalse) {
+#if defined(DEBUG_FONTS)
+ cerr << "FcConfigAppFontAddFile failed to load " << font_file << "\n";
+#endif
+ }
FcPattern* pattern = FcPatternBuild (0, FC_FILE, FcTypeString, font_file.string().c_str(), static_cast<char *> (0));
FcObjectSet* object_set = FcObjectSetBuild (FC_FAMILY, FC_STYLE, FC_LANG, FC_FILE, static_cast<char *> (0));
@@ -141,6 +148,9 @@ render_subtitle (dcp::SubtitleString const & subtitle, list<shared_ptr<Font> > f
/* Render the subtitle at the top left-hand corner of image */
+#if defined(DEBUG_FONTS)
+ cerr << "Font name is " << font_name << "\n";
+#endif
Pango::FontDescription font (font_name);
font.set_absolute_size (subtitle.size_in_pixels (target.height) * PANGO_SCALE);
if (subtitle.italic ()) {