From 1c73379ed8483dcf71c5ccfc459c2c22516a9aef Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 8 Apr 2023 01:04:37 +0200 Subject: Fix subtitle font handling with in-memory fonts from SMPTE (#2509). 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. --- src/tools/dcpomatic.cc | 3 +++ src/tools/dcpomatic_player.cc | 9 +++++++++ 2 files changed, 12 insertions(+) (limited to 'src/tools') diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index d40976094..5b43e510c 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -74,6 +74,7 @@ #include "lib/exceptions.h" #include "lib/ffmpeg_encoder.h" #include "lib/film.h" +#include "lib/font_config.h" #include "lib/hints.h" #include "lib/job_manager.h" #include "lib/kdm_with_metadata.h" @@ -1191,6 +1192,8 @@ private: /* Also stop hearing about analytics-related stuff */ _analytics_message_connection.disconnect (); + FontConfig::drop(); + ev.Skip (); } diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 68460fe68..5ce02b1ea 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -47,6 +47,7 @@ #include "lib/ffmpeg_content.h" #include "lib/file_log.h" #include "lib/film.h" +#include "lib/font_config.h" #include "lib/image.h" #include "lib/image_jpeg.h" #include "lib/image_png.h" @@ -244,6 +245,8 @@ public: Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_timing, this), ID_tools_timing); Bind (wxEVT_MENU, boost::bind (&DOMFrame::tools_system_information, this), ID_tools_system_information); + Bind(wxEVT_CLOSE_WINDOW, boost::bind(&DOMFrame::close, this, _1)); + if (Config::instance()->player_mode() == Config::PLAYER_MODE_DUAL) { auto pc = new PlaylistControls (_overall_panel, _viewer); _controls = pc; @@ -313,6 +316,12 @@ public: _viewer.stop(); } + void close(wxCloseEvent& ev) + { + FontConfig::drop(); + ev.Skip(); + } + void setup_main_sizer (Config::PlayerMode mode) { _main_sizer->Detach(_viewer.panel()); -- cgit v1.2.3