FontSourceType Enumeration

Specifies the type of a font source.

Namespace:  Aspose.Words.Fonts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.7.0

Syntax

public enum FontSourceType

Members

  Member nameValueDescription
FontFile0 A FileFontSource object that represents single font file.
FontsFolder1 A FolderFontSource object that represents folder with font files.
MemoryFont2 A MemoryFontSource object that represents single font in memory.
SystemFonts3 A SystemFontSource object that represents all fonts installed to the system.
FontStream4 A StreamFontSource object that represents a stream with font data.

Examples

Shows how to create a file font source.
Document doc = new Document();

// Create a font settings object for our document
doc.FontSettings = new FontSettings();

// Create a font source from a file in our system
FileFontSource fileFontSource = new FileFontSource(MyDir + "Alte DIN 1451 Mittelschrift.ttf", 0);

// Import the font source into our document
doc.FontSettings.SetFontsSources(new FontSourceBase[] { fileFontSource });

Assert.AreEqual(MyDir + "Alte DIN 1451 Mittelschrift.ttf", fileFontSource.FilePath);
Assert.AreEqual(FontSourceType.FontFile, fileFontSource.Type);
Assert.AreEqual(0, fileFontSource.Priority);

See Also