FolderFontSource
Contents
[
Hide
]FolderFontSource class
Represents the folder that contains TrueType font files.
To learn more, visit the Working with Fonts documentation article.
public class FolderFontSource : FontSourceBase
Constructors
Name | Description |
---|---|
FolderFontSource(string, bool) | Ctor. |
FolderFontSource(string, bool, int) | Ctor. |
Properties
Name | Description |
---|---|
FolderPath { get; } | Path to the folder. |
Priority { get; } | Returns the font source priority. |
ScanSubfolders { get; } | Determines whether or not to scan the subfolders. |
override Type { get; } | Returns the type of the font source. |
WarningCallback { get; set; } | Called during processing of font source when an issue is detected that might result in formatting fidelity loss. |
Methods
Name | Description |
---|---|
GetAvailableFonts() | Returns list of fonts available via this source. |
Examples
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);
See Also
- class FontSourceBase
- namespace Aspose.Words.Fonts
- assembly Aspose.Words