diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-08-26 10:21:50 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-08-26 10:21:50 +0100 |
| commit | ddef0fb991ee50275e801c0cd813b7d74ead6ddf (patch) | |
| tree | 62534c7494d13f5f0173726ef4c26fd0b100a545 /src | |
| parent | b1a681c63cd892f91c9825a517b741dee9eb2b26 (diff) | |
Hack to make font finding work on Ubuntu even when not installed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/render_subtitles.cc | 9 |
1 files changed, 8 insertions, 1 deletions
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<shared_ptr<Font> > 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<Font> i, fonts) { if (i->id() == subtitle.font() && i->file ()) { font_file = i->file().get (); |
