diff options
Diffstat (limited to 'src/subtitle_asset.cc')
| -rw-r--r-- | src/subtitle_asset.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index f35b47ef..176ee02b 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -662,11 +662,21 @@ SubtitleAsset::pull_fonts (shared_ptr<order::Part> part) } +void +SubtitleAsset::clear_fonts(shared_ptr<order::Part> part) +{ + part->font.clear(); + for (auto child: part->children) { + clear_fonts(child); + } +} + + /** @param standard Standard (INTEROP or SMPTE); this is used rather than putting things in the child * class because the differences between the two are fairly subtle. */ void -SubtitleAsset::subtitles_as_xml (xmlpp::Element* xml_root, int time_code_rate, Standard standard) const +SubtitleAsset::subtitles_as_xml(xmlpp::Element* xml_root, int time_code_rate, Standard standard, FontTags fonts) const { auto sorted = _subtitles; std::stable_sort(sorted.begin(), sorted.end(), SubtitleSorter()); @@ -741,9 +751,12 @@ SubtitleAsset::subtitles_as_xml (xmlpp::Element* xml_root, int time_code_rate, S } } - /* Pull font changes as high up the hierarchy as we can */ - - pull_fonts (root); + if (fonts == FontTags::INCLUDE) { + /* Pull font changes as high up the hierarchy as we can */ + pull_fonts(root); + } else { + clear_fonts(root); + } /* Write XML */ |
