diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-05 00:46:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-03-05 23:52:14 +0100 |
| commit | 474e13cf51457a51a6870c324e77ca30290a0d28 (patch) | |
| tree | 9a96ab781a07fff8c84812d7dd0570eac83dddbb /src/lib/content.cc | |
| parent | aa10e37a255a63dc269fb30358a5946d558e39b0 (diff) | |
Add Content::{font_paths,replace_font_path}().
Diffstat (limited to 'src/lib/content.cc')
| -rw-r--r-- | src/lib/content.cc | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc index 60073f860..5e3d01847 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -31,6 +31,7 @@ #include "content_factory.h" #include "exceptions.h" #include "film.h" +#include "font.h" #include "job.h" #include "text_content.h" #include "util.h" @@ -570,3 +571,33 @@ Content::has_mapped_audio() const return audio && !audio->mapping().mapped_output_channels().empty(); } + +vector<boost::filesystem::path> +Content::font_paths() const +{ + vector<boost::filesystem::path> paths; + + for (auto i: text) { + for (auto j: i->fonts()) { + if (j->file()) { + paths.push_back(*j->file()); + } + } + } + + return paths; +} + + +void +Content::replace_font_path(boost::filesystem::path old_path, boost::filesystem::path new_path) +{ + for (auto i: text) { + for (auto j: i->fonts()) { + if (j->file() && *j->file() == old_path) { + j->set_file(new_path); + } + } + } +} + |
