diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-10-14 21:40:32 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-10-14 21:40:32 +0200 |
| commit | daf0a05178ac6370440594e124bc25162f053176 (patch) | |
| tree | 06bd25487723071ce411d4dc6828f378748e0fe0 /src/lib/text_decoder.cc | |
| parent | 2c04079119ff13a22388d4f130c5a19b8fa06583 (diff) | |
Cleanup: assert result of get_font().
Diffstat (limited to 'src/lib/text_decoder.cc')
| -rw-r--r-- | src/lib/text_decoder.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/text_decoder.cc b/src/lib/text_decoder.cc index 1ecdcd347..aca6946b7 100644 --- a/src/lib/text_decoder.cc +++ b/src/lib/text_decoder.cc @@ -132,12 +132,9 @@ TextDecoder::emit_plain_start(ContentTime from, vector<dcp::SubtitleString> subt vector<StringText> string_texts; for (auto& subtitle: subtitles) { - auto string_text = StringText( - subtitle, - content()->outline_width(), - content()->get_font(subtitle.font().get_value_or("")), - valign_standard - ); + auto font = content()->get_font(subtitle.font().get_value_or("")); + DCPOMATIC_ASSERT(font); + auto string_text = StringText(subtitle, content()->outline_width(), font, valign_standard); string_text.set_text(remove_invalid_characters_for_xml(string_text.text())); set_forced_appearance(content(), string_text); string_texts.push_back(string_text); @@ -307,10 +304,13 @@ TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & sub_subti 0 ); + auto font = content()->get_font(block.font.get_value_or("")); + DCPOMATIC_ASSERT(font); + auto string_text = StringText( dcp_subtitle, content()->outline_width(), - content()->get_font(block.font.get_value_or("")), + font, dcp::SubtitleStandard::SMPTE_2014 ); set_forced_appearance(content(), string_text); |
