Add Ubuntu font hack.
authorCarl Hetherington <cth@carlh.net>
Wed, 26 Aug 2015 09:31:05 +0000 (10:31 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 26 Aug 2015 09:31:05 +0000 (10:31 +0100)
src/lib/writer.cc

index b7c85c2ae06f6f25dadecea75ba3d01a3f619296..2571ce3cbdc89eecf9ecc5acbb42b7e0f2fb60f4 100644 (file)
@@ -557,7 +557,13 @@ Writer::finish ()
        }
 
        if (_subtitle_asset) {
-               boost::filesystem::path const liberation = shared_path () / "LiberationSans-Regular.ttf";
+               boost::filesystem::path liberation;
+               try {
+                       liberation = shared_path () / "LiberationSans-Regular.ttf";
+               } catch (boost::filesystem::filesystem_error& e) {
+                       /* Hack: try the debian/ubuntu location if getting the shared path failed */
+                       liberation = "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf";
+               }
 
                /* Add all the fonts to the subtitle content */
                BOOST_FOREACH (shared_ptr<Font> i, _fonts) {