Don't search for empty font names to avoid random fonts being chosen.
[dcpomatic.git] / src / lib / string_text_file_content.cc
index eea9362bbc384369b4fc05e0d00f4040724d500b..934144fa411d6d6fdd7ddfe1c4158501b2e5e948 100644 (file)
@@ -40,6 +40,7 @@ using std::list;
 using std::make_shared;
 using std::shared_ptr;
 using std::string;
+using boost::optional;
 using dcp::raw_convert;
 using namespace dcpomatic;
 
@@ -78,7 +79,10 @@ StringTextFileContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job
        }
 
        for (auto name: names) {
-               auto path = FontConfig::instance()->system_font_with_name(name);
+               optional<boost::filesystem::path> path;
+               if (!name.empty()) {
+                       path = FontConfig::instance()->system_font_with_name(name);
+               }
                if (path) {
                        only_text()->add_font(make_shared<Font>(name, *path));
                } else {