From ddcd4f3ba0af3e9d49dbb68127317cd0d871a248 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 20 Dec 2020 23:41:52 +0100 Subject: 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). --- src/lib/string_text_file_decoder.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/lib/string_text_file_decoder.cc') diff --git a/src/lib/string_text_file_decoder.cc b/src/lib/string_text_file_decoder.cc index 4cf34a3a9..691734d7b 100644 --- a/src/lib/string_text_file_decoder.cc +++ b/src/lib/string_text_file_decoder.cc @@ -89,3 +89,17 @@ StringTextFileDecoder::content_time_period (sub::Subtitle s) const ContentTime::from_seconds (s.to.all_as_seconds()) ); } + + +vector +StringTextFileDecoder::fonts () const +{ + vector data; + BOOST_FOREACH (shared_ptr i, text) { + BOOST_FOREACH (shared_ptr j, i->content()->fonts()) { + data.push_back (FontData(j)); + } + } + return data; +} + -- cgit v1.2.3