Aspose::Words::Fonts::FolderFontSource::FolderFontSource constructor

FolderFontSource::FolderFontSource(const System::String&, bool) constructor

Ctor.

Aspose::Words::Fonts::FolderFontSource::FolderFontSource(const System::String &folderPath, bool scanSubfolders)
ParameterTypeDescription
folderPathconst System::String&Path to folder.
scanSubfoldersboolDetermines whether or not to scan subfolders.

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

FolderFontSource::FolderFontSource(const System::String&, bool, int32_t) constructor

Ctor.

Aspose::Words::Fonts::FolderFontSource::FolderFontSource(const System::String &folderPath, bool scanSubfolders, int32_t priority)
ParameterTypeDescription
folderPathconst System::String&Path to folder.
scanSubfoldersboolDetermines whether or not to scan subfolders.
priorityint32_tFont source priority. See the Priority property description for more information.

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