diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-09-10 23:37:23 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-11 01:03:42 +0200 |
| commit | 02d5b8c73ca3d8d18397658425b0e8f2d5e4e90a (patch) | |
| tree | d0cfd409c3f5a1158c725445104c94776f17e98f /src | |
| parent | 759ebfc9322cda595a793be004e086389229e65d (diff) | |
Add font_filenames()
Diffstat (limited to 'src')
| -rw-r--r-- | src/subtitle_asset.cc | 14 | ||||
| -rw-r--r-- | src/subtitle_asset.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index 4c042974..02350f00 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -657,6 +657,20 @@ SubtitleAsset::font_data () const return out; } + +map<string, boost::filesystem::path> +SubtitleAsset::font_filenames () const +{ + map<string, boost::filesystem::path> out; + BOOST_FOREACH (Font const& i, _fonts) { + if (i.file) { + out[i.load_id] = *i.file; + } + } + return out; +} + + /** Replace empty IDs in any <LoadFontId> and <Font> tags with * a dummy string. Some systems give errors with empty font IDs * (see DCP-o-matic bug #1689). diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h index 50f723da..b66e88b1 100644 --- a/src/subtitle_asset.h +++ b/src/subtitle_asset.h @@ -95,6 +95,7 @@ public: virtual void add (boost::shared_ptr<Subtitle>); virtual void add_font (std::string id, boost::filesystem::path file) = 0; std::map<std::string, Data> font_data () const; + std::map<std::string, boost::filesystem::path> font_filenames () const; virtual void write (boost::filesystem::path) const = 0; virtual std::string xml_as_string () const = 0; |
