LoadExternalFonts()

FontsLoader::LoadExternalFonts(System::ArrayPtr<System::String>) method

Adds additional folders to seek fonts.

static void Aspose::Slides::FontsLoader::LoadExternalFonts(System::ArrayPtr<System::String> directories)

Arguments

ParameterTypeDescription
directoriesSystem::ArrayPtr<System::String>Directories to read additional fonts.

Remarks

The follow examples shows how to load custom fonts from .TTF

// The path to the documents directory.
System::String dataDir = u"C:\\";

// folders to seek fonts
System::ArrayPtr<System::String> folders = System::MakeArray<System::String>({dataDir});

// Load the custom font directory fonts
FontsLoader::LoadExternalFonts(folders);

// Do some work and perform presentation/slides rendering
auto presentation = System::MakeObject<Presentation>(dataDir + u"DefaultFonts.pptx");
presentation->Save(dataDir + u"NewFonts_out.pptx", SaveFormat::Pptx);

// Clear Font Cache
FontsLoader::ClearCache();

See Also