FontSourceBase Class

This is an abstract base class for the classes that allow the user to specify various font sources.
Inheritance Hierarchy

Namespace:  Aspose.Words.Fonts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public abstract class FontSourceBase

The FontSourceBase type exposes the following members.

Properties
  NameDescription
Public propertyCode examplePriority
Returns the font source priority.
Public propertyCode exampleType
Returns the type of the font source.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Public methodCode exampleGetAvailableFonts
Returns list of fonts available via this source.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)
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