diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/content.cc | 31 | ||||
| -rw-r--r-- | src/lib/content.h | 3 |
2 files changed, 34 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); + } + } + } +} + diff --git a/src/lib/content.h b/src/lib/content.h index bee7419dd..8ddb7d7e7 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -139,6 +139,9 @@ public: return _paths[i]; } + std::vector<boost::filesystem::path> font_paths() const; + void replace_font_path(boost::filesystem::path old_path, boost::filesystem::path new_path); + std::time_t last_write_time(size_t i) const { boost::mutex::scoped_lock lm(_mutex); return _last_write_times[i]; |
