Aspose::Words::Fonts::FolderFontSource class
Contents
[
Hide
]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
Method | Description |
---|---|
FolderFontSource(const System::String&, bool) | Ctor. |
FolderFontSource(const System::String&, bool, int32_t) | Ctor. |
get_FolderPath() const | Path to the folder. |
get_Priority() const | Returns the font source priority. |
get_ScanSubfolders() const | Determines whether or not to scan the subfolders. |
get_Type() override | Returns the type of the font source. |
get_WarningCallback() const | Called 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
- Class FontSourceBase
- Namespace Aspose::Words::Fonts
- Library Aspose.Words for C++