Add font_filenames()
authorCarl Hetherington <cth@carlh.net>
Thu, 10 Sep 2020 21:37:23 +0000 (23:37 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 10 Sep 2020 23:03:42 +0000 (01:03 +0200)
src/subtitle_asset.cc
src/subtitle_asset.h

index 4c0429748bfe209832e976d153e08bbd1f840449..02350f00d681d18edf9e9c2afd9985048feb17d3 100644 (file)
@@ -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).
index 50f723da73a2a9ab6a5df0517f8fe1e6820f514b..b66e88b10706379f1fe84cfe47e3687c3bba5c56 100644 (file)
@@ -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;