X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Ffont_config.cc;h=8804bd6d96522b8aa2baf0a8b9e341405393766e;hp=d4a442fc1f84434978b0ec02eaabce5fd6f89bd6;hb=22aa0dd620b6db93a64e1e171fb5ddb18693e56e;hpb=f6a51c4902d6c1983d58e1073f048d50ba2a50df diff --git a/src/lib/font_config.cc b/src/lib/font_config.cc index d4a442fc1..8804bd6d9 100644 --- a/src/lib/font_config.cc +++ b/src/lib/font_config.cc @@ -56,7 +56,7 @@ FontConfig::~FontConfig() string FontConfig::make_font_available(shared_ptr font) { - auto existing = _available_fonts.find(font->id()); + auto existing = _available_fonts.find(font->content()); if (existing != _available_fonts.end()) { return existing->second; } @@ -107,7 +107,10 @@ FontConfig::make_font_available(shared_ptr font) DCPOMATIC_ASSERT(font_name); - _available_fonts[font->id()] = *font_name; + /* We need to use the font object as the key, as we may be passed the same shared_ptr to a modified + * Font object in the future and in that case we need to load the new font. + */ + _available_fonts[font->content()] = *font_name; FcConfigBuildFonts(_config); return *font_name;