diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-09-10 23:37:32 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-11 01:03:42 +0200 |
| commit | c433039121e361d4466ac626d879edaa18050ffb (patch) | |
| tree | 691f82ef8a8f3e94f3cc430b184992f050945f00 /src | |
| parent | 02d5b8c73ca3d8d18397658425b0e8f2d5e4e90a (diff) | |
Add set_font_file()
Diffstat (limited to 'src')
| -rw-r--r-- | src/interop_subtitle_asset.cc | 18 | ||||
| -rw-r--r-- | src/interop_subtitle_asset.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index f6410520..f7e38965 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -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(); + } + } +} + diff --git a/src/interop_subtitle_asset.h b/src/interop_subtitle_asset.h index ba8b5edf..4b96c795 100644 --- a/src/interop_subtitle_asset.h +++ b/src/interop_subtitle_asset.h @@ -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. |
