FontSourceBase Class

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

ExpandedInheritance Hierarchy

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

ExpandedSyntax

public abstract class FontSourceBase

The FontSourceBase type exposes the following members.

ExpandedProperties

  NameDescription
Public propertyCode examplePriority
Returns the font source priority.
Public propertyCode exampleType
Returns the type of the font source.
Public propertyCode exampleWarningCallback
Called during processing of font source when an issue is detected that might result in formatting fidelity loss.

ExpandedMethods

  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodCode exampleGetAvailableFonts
Returns list of fonts available via this source.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)

ExpandedExamples

Shows how to use a font file in the local file system as a font source.
FileFontSource fileFontSource = new FileFontSource(MyDir + "Alte DIN 1451 Mittelschrift.ttf", 0);

Document doc = new Document();
doc.FontSettings = new FontSettings();
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);

ExpandedSee Also