summaryrefslogtreecommitdiff
path: root/src/interop_subtitle_asset.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-05-16 23:12:40 +0200
committerCarl Hetherington <cth@carlh.net>2023-05-16 23:12:40 +0200
commitf68a99a93b7a735d9983d8946f058a71f5b11cd4 (patch)
treea9b58d25a1a3268b3448e75d3205214c3f0c1ead /src/interop_subtitle_asset.cc
parent245faa7fc2eb88a761e8d52603766b27b5a880c8 (diff)
Make it possible to write subtitle assets without any <Font> tags.2525-ccap-fonts
Diffstat (limited to 'src/interop_subtitle_asset.cc')
-rw-r--r--src/interop_subtitle_asset.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc
index 8fb115a7..57468908 100644
--- a/src/interop_subtitle_asset.cc
+++ b/src/interop_subtitle_asset.cc
@@ -107,7 +107,7 @@ InteropSubtitleAsset::InteropSubtitleAsset ()
string
-InteropSubtitleAsset::xml_as_string () const
+InteropSubtitleAsset::xml_as_string(FontTags font_tags) const
{
xmlpp::Document doc;
auto root = doc.create_root_node ("DCSubtitle");
@@ -124,7 +124,7 @@ InteropSubtitleAsset::xml_as_string () const
load_font->set_attribute ("URI", i->uri);
}
- subtitles_as_xml (root, 250, Standard::INTEROP);
+ subtitles_as_xml(root, 250, Standard::INTEROP, font_tags);
return format_xml(doc, {});
}
@@ -190,14 +190,14 @@ InteropSubtitleAsset::load_font_nodes () const
void
-InteropSubtitleAsset::write (boost::filesystem::path p) const
+InteropSubtitleAsset::write(boost::filesystem::path p, FontTags font_tags) const
{
File f(p, "wb");
if (!f) {
throw FileError ("Could not open file for writing", p, -1);
}
- _raw_xml = xml_as_string ();
+ _raw_xml = xml_as_string(font_tags);
/* length() here gives bytes not characters */
f.write(_raw_xml->c_str(), 1, _raw_xml->length());