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/subtitle_encoder.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/subtitle_encoder.cc')
| -rw-r--r-- | src/lib/subtitle_encoder.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/subtitle_encoder.cc b/src/lib/subtitle_encoder.cc index b018dcfb4..473d0698b 100644 --- a/src/lib/subtitle_encoder.cc +++ b/src/lib/subtitle_encoder.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2019 Carl Hetherington <cth@carlh.net> + Copyright (C) 2019-2020 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -18,7 +18,7 @@ */ -#include "font.h" +#include "font_data.h" #include "subtitle_encoder.h" #include "player.h" #include "compose.hpp" @@ -81,6 +81,8 @@ SubtitleEncoder::SubtitleEncoder (shared_ptr<const Film> film, shared_ptr<Job> j BOOST_FOREACH (dcpomatic::DCPTimePeriod i, film->reels()) { _reels.push_back (i); } + + _default_font = dcp::ArrayData (default_font_file()); } void @@ -114,8 +116,8 @@ SubtitleEncoder::go () } if (!_film->interop() || _include_font) { - BOOST_FOREACH (shared_ptr<dcpomatic::Font> j, _player->get_subtitle_fonts()) { - i->first->add_font (j->id(), default_font_file()); + BOOST_FOREACH (dcpomatic::FontData j, _player->get_subtitle_fonts()) { + i->first->add_font (j.id, _default_font); } } |
