commit
149fd8b569
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user