diff --git a/tsMuxer/osdep/textSubtitlesRenderFT.cpp b/tsMuxer/osdep/textSubtitlesRenderFT.cpp index 2aaa3c9..d0bb1b7 100644 --- a/tsMuxer/osdep/textSubtitlesRenderFT.cpp +++ b/tsMuxer/osdep/textSubtitlesRenderFT.cpp @@ -27,6 +27,8 @@ const static char FONT_ROOT[] = "/System/Library/Fonts/"; #include #include +#include + using namespace std; namespace text_subtitles @@ -101,10 +103,12 @@ void TextSubtitlesRenderFT::loadFontMap() std::map::iterator itr = m_fontNameToFile.find(fontFamily); - if (itr == m_fontNameToFile.end()) - m_fontNameToFile[fontFamily] = fileList[i]; - else if (fileList[i].length() < itr->second.length()) - m_fontNameToFile[fontFamily] = fileList[i]; + if (itr == m_fontNameToFile.end() || fileList[i].length() < itr->second.length()) +#if defined(__APPLE__) && defined(__MACH__) + m_fontNameToFile[fontFamily] = std::__fs::filesystem::canonical(fileList[i]).string(); +#else + m_fontNameToFile[fontFamily] = std::filesystem::canonical(fileList[i]).string(); +#endif FT_Done_Face(font); }