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

index f64105208ae7b6c3dc1765d01e6412985ed3aeac..f7e3896528cafc8fadd184b39d5a4789cae92c61 100644 (file)
@@ -276,3 +276,21 @@ InteropSubtitleAsset::add_to_pkl (shared_ptr<PKL> pkl, boost::filesystem::path r
                }
        }
 }
+
+
+void
+InteropSubtitleAsset::set_font_file (string load_id, boost::filesystem::path file)
+{
+       BOOST_FOREACH (Font& i, _fonts) {
+               if (i.load_id == load_id) {
+                       i.file = file;
+               }
+       }
+
+       BOOST_FOREACH (shared_ptr<InteropLoadFontNode> i, _load_font_nodes) {
+               if (i->id == load_id) {
+                       i->uri = file.filename().string();
+               }
+       }
+}
+
index ba8b5edf16ef08cfda87b365178ec3217a2bce9c..4b96c795605850ea633be5003b11624454e5a110 100644 (file)
@@ -70,6 +70,7 @@ public:
        void write (boost::filesystem::path path) const;
        void resolve_fonts (std::list<boost::shared_ptr<Asset> > assets);
        void add_font_assets (std::list<boost::shared_ptr<Asset> >& assets);
+       void set_font_file (std::string load_id, boost::filesystem::path file);
 
        /** Set the reel number or sub-element identifier
         *  of these subtitles.