Aspose::Words::Fonts::FolderFontSource class

FolderFontSource class

Represents the folder that contains TrueType font files. To learn more, visit the Working with Fonts documentation article.

class FolderFontSource : public Aspose::Words::Fonts::FontSourceBase

Methods

MethodDescription
FolderFontSource(const System::String&, bool)Ctor.
FolderFontSource(const System::String&, bool, int32_t)Ctor.
get_FolderPath() constPath to the folder.
get_Priority() constReturns the font source priority.
get_ScanSubfolders() constDetermines whether or not to scan the subfolders.
get_Type() overrideReturns the type of the font source.
get_WarningCallback() constCalled during processing of font source when an issue is detected that might result in formatting fidelity loss.
GetAvailableFonts()Returns list of fonts available via this source.
GetType() const override
Is(const System::TypeInfo&) const override
set_WarningCallback(const System::SharedPtr<Aspose::Words::IWarningCallback>&)Setter for Aspose::Words::Fonts::FontSourceBase::get_WarningCallback.
static Type()

Examples

Shows how to use a local system folder which contains fonts as a font source.

// Create a font source from a folder that contains font files.
auto folderFontSource = MakeObject<FolderFontSource>(FontsDir, false, 1);

auto doc = MakeObject<Document>();
doc->set_FontSettings(MakeObject<FontSettings>());
doc->get_FontSettings()->SetFontsSources(MakeArray<SharedPtr<FontSourceBase>>({folderFontSource}));

ASSERT_EQ(FontsDir, folderFontSource->get_FolderPath());
ASPOSE_ASSERT_EQ(false, folderFontSource->get_ScanSubfolders());
ASSERT_EQ(FontSourceType::FontsFolder, folderFontSource->get_Type());
ASSERT_EQ(1, folderFontSource->get_Priority());

See Also