Aspose::Words::Fonts::FontSourceType enum
Contents
[
Hide
]FontSourceType enum
Specifies the type of font source.
enum class FontSourceType : int
Values
| Name | Value | Description |
|---|---|---|
| FontFile | 0 | A FileFontSource object that represents single font file. |
| FontStream | 4 | A StreamFontSource object that represents a stream with font data. |
| FontsFolder | 1 | A FolderFontSource object that represents folder with font files. |
| MemoryFont | 2 | A MemoryFontSource object that represents single font in memory. |
| SystemFonts | 3 | A SystemFontSource object that represents all fonts installed to the system. |
Examples
Shows how to use a font file in the local file system as a font source.
auto fileFontSource = System::MakeObject<Aspose::Words::Fonts::FileFontSource>(get_MyDir() + u"Alte DIN 1451 Mittelschrift.ttf", 0);
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>>({fileFontSource}));
ASSERT_EQ(fileFontSource->get_FilePath(), get_MyDir() + u"Alte DIN 1451 Mittelschrift.ttf");
ASSERT_EQ(fileFontSource->get_Type(), FontSourceType::FontFile);
ASSERT_EQ(fileFontSource->get_Priority(), 0);
See Also
- Namespace Aspose::Words::Fonts
- Library Aspose.Words for C++