LoadExternalFonts call is very slow. Is there any way to improve performance?
Sample code I am using:
std::vector<String> candidatePaths;
#ifdef MACINTOSH
candidatePaths = {
u"/Applications/Microsoft PowerPoint.app/Contents/Resources/DFonts",
u"/Applications/Microsoft PowerPoint.app/Contents/Resources/Fonts",
};
#endif
std::vector<String> validPaths;
validPaths.reserve(candidatePaths.size());
for (const auto &path : candidatePaths)
{
if (System::IO::Directory::Exists(path))
{
validPaths.push_back(path);
}
}
if (!validPaths.empty())
{
auto fontFolders = MakeObject<Array<String>>(validPaths.size());
for (size_t i = 0; i < validPaths.size(); ++i)
{
(*fontFolders)[i] = validPaths[i];
}
try
{
FontsLoader::LoadExternalFonts(fontFolders);
}