Aspose::Words::Fonts::FolderFontSource::get_Type method

FolderFontSource::get_Type method

Returns the type of the font source.

Aspose::Words::Fonts::FontSourceType Aspose::Words::Fonts::FolderFontSource::get_Type() override

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