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 = System::MakeObject<Aspose::Words::Fonts::FolderFontSource>(get_FontsDir(), false, 1);

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

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

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 = System::MakeObject<Aspose::Words::Fonts::FolderFontSource>(get_FontsDir(), false, 1);

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

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

See Also