Adjust subtitle position when referenced from top.
[dcpomatic.git] / src / lib / reel_writer.cc
index 803c2a8ed42ae266518aea5ca05edca905f7a39d..c8d848933a566e040afaa4d611efab346995e8ad 100644 (file)
@@ -366,12 +366,18 @@ ReelWriter::create_reel (list<ReferencedReelAsset> const & refs, list<shared_ptr
 
                boost::filesystem::path liberation_normal;
                try {
-                       liberation_normal = shared_path () / "LiberationSans-Regular.ttf";
+                       liberation_normal = shared_path() / "LiberationSans-Regular.ttf";
+                       if (!boost::filesystem::exists (liberation_normal)) {
+                               /* Hack for unit tests */
+                               liberation_normal = shared_path() / "fonts" / "LiberationSans-Regular.ttf";
+                       }
                } catch (boost::filesystem::filesystem_error& e) {
-                       /* Hack: try the debian/ubuntu location if getting the shared path failed */
-                       liberation_normal = "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf";
+
                }
 
+               if (!boost::filesystem::exists(liberation_normal)) {
+                       liberation_normal = "/usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf";
+               }
 
                /* Add all the fonts to the subtitle content */
                BOOST_FOREACH (shared_ptr<Font> j, fonts) {