diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-12-20 23:41:52 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-12-22 02:37:53 +0100 |
| commit | ddcd4f3ba0af3e9d49dbb68127317cd0d871a248 (patch) | |
| tree | 1091683b8dcaf82cd517b844be1d76f290f88f50 /src/lib/dcp_decoder.cc | |
| parent | bf4446523dd891049cabf1bcd68d20def57bc731 (diff) | |
Pass fonts from content around as FontData.
i.e. as a block of memory rather than a file. Also, get the
fonts from the decoder rather than the content.
Together, these changes allow us to use fonts from SMPTE DCPs
added as content. Before, fonts would be messed up in those
cases (#1885).
Diffstat (limited to 'src/lib/dcp_decoder.cc')
| -rw-r--r-- | src/lib/dcp_decoder.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 758ddea26..17710a3bd 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -56,7 +56,9 @@ using std::list; using std::cout; +using std::map; using std::string; +using std::vector; using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::optional; @@ -487,3 +489,20 @@ DCPDecoder::position () const { return ContentTime::from_frames(_offset, _dcp_content->active_video_frame_rate(film())) + _next; } + + +vector<FontData> +DCPDecoder::fonts () const +{ + vector<FontData> data; + BOOST_FOREACH (shared_ptr<dcp::Reel> i, _reels) { + if (i->main_subtitle() && i->main_subtitle()->asset()) { + map<string, dcp::ArrayData> fm = i->main_subtitle()->asset()->font_data(); + for (map<string, dcp::ArrayData>::const_iterator j = fm.begin(); j != fm.end(); ++j) { + data.push_back (FontData(j->first, j->second)); + } + } + } + return data; +} + |
