+
+
+shared_ptr<dcpomatic::Font>
+TextContent::get_font(string id) const
+{
+ boost::mutex::scoped_lock lm(_mutex);
+ return get_font_unlocked(id);
+}
+
+
+shared_ptr<dcpomatic::Font>
+TextContent::get_font_unlocked(string id) const
+{
+ auto iter = std::find_if(_fonts.begin(), _fonts.end(), [&id](shared_ptr<dcpomatic::Font> font) {
+ return font->id() == id;
+ });
+
+ if (iter == _fonts.end()) {
+ return {};
+ }
+
+ return *iter;
+}
+
+
+void
+TextContent::clear_fonts()
+{
+ boost::mutex::scoped_lock lm(_mutex);
+
+ _fonts.clear();
+}
+