diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-12-20 22:29:21 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-12-20 22:29:21 +0000 |
| commit | 5f2a57d1c21c3e8067dfd1f68505b1bf96e1d7c7 (patch) | |
| tree | 01e112c11223eb94772e86ca40fbefdb7ec05b8e /src/lib/writer.cc | |
| parent | b607482671ee26a3462d9fcefdd7d7ddcd25184c (diff) | |
Basic pass-through of font information when using DCP subtitles.
Diffstat (limited to 'src/lib/writer.cc')
| -rw-r--r-- | src/lib/writer.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 5a6998c8a..07b637d46 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -32,6 +32,7 @@ #include "md5_digester.h" #include "encoded_data.h" #include "version.h" +#include "font.h" #include <dcp/mono_picture_mxf.h> #include <dcp/stereo_picture_mxf.h> #include <dcp/sound_mxf.h> @@ -616,7 +617,7 @@ Writer::write (PlayerSubtitles subs) } if (!_subtitle_content) { - _subtitle_content.reset (new dcp::InteropSubtitleContent (_film->name(), subs.language)); + _subtitle_content.reset (new dcp::InteropSubtitleContent (_film->name(), _film->subtitle_language ())); } for (list<dcp::SubtitleString>::const_iterator i = subs.text.begin(); i != subs.text.end(); ++i) { @@ -624,6 +625,19 @@ Writer::write (PlayerSubtitles subs) } } +void +Writer::write (list<shared_ptr<Font> > fonts) +{ + if (!_subtitle_content) { + _subtitle_content.reset (new dcp::InteropSubtitleContent (_film->name(), _film->subtitle_language ())); + } + + for (list<shared_ptr<Font> >::const_iterator i = fonts.begin(); i != fonts.end(); ++i) { + /* XXX: this LiberationSans-Regular needs to be a path to a DCP-o-matic-distributed copy */ + _subtitle_content->add_font ((*i)->id, (*i)->file.get_value_or ("LiberationSans-Regular.ttf").leaf().string ()); + } +} + bool operator< (QueueItem const & a, QueueItem const & b) { |
