summaryrefslogtreecommitdiff
path: root/src/lib/font_config.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-04-08 01:04:37 +0200
committerCarl Hetherington <cth@carlh.net>2023-04-09 17:23:20 +0200
commit1c73379ed8483dcf71c5ccfc459c2c22516a9aef (patch)
tree2da4861633a408e4a1fef78cc5cb9f608794bd1d /src/lib/font_config.h
parent46193d2898321c70626a80785055884396f3e09d (diff)
Fix subtitle font handling with in-memory fonts from SMPTE (#2509).v2.16.52
Previously we would fail to make a font available if it came from a SMPTE MXF. In that case we have a memory buffer containing the TTF/OTF file but no file; here we add a hack/workaround so that in-memory font files can be used by FontConfig.
Diffstat (limited to 'src/lib/font_config.h')
-rw-r--r--src/lib/font_config.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/font_config.h b/src/lib/font_config.h
index 6dadbae8a..edcb4be36 100644
--- a/src/lib/font_config.h
+++ b/src/lib/font_config.h
@@ -31,14 +31,19 @@ class FontConfig
public:
static FontConfig* instance();
- std::string make_font_available(boost::filesystem::path font_file);
+ std::string make_font_available(std::shared_ptr<dcpomatic::Font> font);
boost::optional<boost::filesystem::path> system_font_with_name(std::string name);
+ static void drop();
+
private:
FontConfig();
+ ~FontConfig();
FcConfig* _config = nullptr;
- std::map<boost::filesystem::path, std::string> _available_fonts;
+ std::map<std::string, std::string> _available_fonts;
+
+ std::vector<boost::filesystem::path> _temp_files;
static FontConfig* _instance;
};