Aspose.Slides for C++: LoadExternalFonts Method Is Very Slow

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);
		}

@pankajku,
Thank you for posting the question.

Could you please share a few details to help us pinpoint why FontsLoader::LoadExternalFonts is slow on your side?

  • Environment: exact Aspose.Slides for C++ version, OS version, CPU, build type (Debug/Release), storage type (SSD/HDD).
  • Timing: wall-clock duration of the FontsLoader::LoadExternalFonts call.
  • Inputs: for each directory the number of font files and total size, the font formats involved (TTF/OTF/TTC). If possible, include timings per directory.
  • Experiments: a minimal sample font set.