using boost::shared_ptr;
using boost::optional;
using boost::dynamic_pointer_cast;
+using dcp::Data;
int const ReelWriter::_info_size = 48;
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) {
}
}
- for (list<dcp::SubtitleString>::const_iterator i = subs.text.begin(); i != subs.text.end(); ++i) {
- _subtitle_asset->add (*i);
+ BOOST_FOREACH (dcp::SubtitleString i, subs.text) {
+ i.set_in (i.in() - dcp::Time (_period.from.seconds(), i.in().tcr));
+ i.set_out (i.out() - dcp::Time (_period.from.seconds(), i.out().tcr));
+ _subtitle_asset->add (i);
}
}