Merge pull request #466 from jcdr428/Symlink

Symlink
This commit is contained in:
jcdr428 2021-09-22 21:58:19 +00:00 committed by GitHub
commit 149fd8b569
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,8 @@ const static char FONT_ROOT[] = "/System/Library/Fonts/";
#include <freetype/ftstroke.h>
#include <fs/systemlog.h>
#include <filesystem>
using namespace std;
namespace text_subtitles
@ -101,10 +103,12 @@ void TextSubtitlesRenderFT::loadFontMap()
std::map<std::string, std::string>::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);
}