From: Carl Hetherington Date: Wed, 26 Aug 2015 09:21:50 +0000 (+0100) Subject: Hack to make font finding work on Ubuntu even when not installed. X-Git-Tag: v2.1.47~33 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=ddef0fb991ee50275e801c0cd813b7d74ead6ddf Hack to make font finding work on Ubuntu even when not installed. --- diff --git a/src/lib/render_subtitles.cc b/src/lib/render_subtitles.cc index a047c8173..4158b7473 100644 --- a/src/lib/render_subtitles.cc +++ b/src/lib/render_subtitles.cc @@ -86,7 +86,14 @@ render_subtitle (dcp::SubtitleString const & subtitle, list > f fc_config = FcConfigCreate (); } - boost::filesystem::path font_file = shared_path () / "LiberationSans-Regular.ttf"; + boost::filesystem::path font_file; + try { + font_file = shared_path () / "LiberationSans-Regular.ttf"; + } catch (boost::filesystem::filesystem_error& e) { + /* Hack: try the debian/ubuntu location if getting the shared path failed */ + font_file = "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf"; + } + BOOST_FOREACH (shared_ptr i, fonts) { if (i->id() == subtitle.font() && i->file ()) { font_file = i->file().get ();