FolderFontSource Class

Represents the folder that contains TrueType font files.

ExpandedInheritance Hierarchy

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

ExpandedSyntax

public class FolderFontSource : FontSourceBase

The FolderFontSource type exposes the following members.

ExpandedConstructors

ExpandedProperties

  NameDescription
Public propertyCode exampleFolderPath
Path to the folder.
Public propertyCode examplePriority
Returns the font source priority.
(Inherited from FontSourceBase.)
Public propertyCode exampleScanSubfolders
Determines whether or not to scan the subfolders.
Public propertyCode exampleType
Returns the type of the font source.
(Overrides FontSourceBaseType.)
Public propertyCode exampleWarningCallback
Called during processing of font source when an issue is detected that might result in formatting fidelity loss.
(Inherited from FontSourceBase.)

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.
(Inherited from FontSourceBase.)
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 local system folder which contains fonts as a font source.
// Create a font source from a folder that contains font files.
FolderFontSource folderFontSource = new FolderFontSource(FontsDir, false, 1);

Document doc = new Document();
doc.FontSettings = new FontSettings();
doc.FontSettings.SetFontsSources(new FontSourceBase[] { folderFontSource });

Assert.AreEqual(FontsDir, folderFontSource.FolderPath);
Assert.AreEqual(false, folderFontSource.ScanSubfolders);
Assert.AreEqual(FontSourceType.FontsFolder, folderFontSource.Type);
Assert.AreEqual(1, folderFontSource.Priority);

ExpandedSee Also