FileFontSource
Contents
[
Hide
]FileFontSource class
Represents the single TrueType font file stored in the file system.
To learn more, visit the Working with Fonts documentation article.
public class FileFontSource : FontSourceBase
Constructors
Name | Description |
---|---|
FileFontSource(string) | Ctor. |
FileFontSource(string, int) | Ctor. |
FileFontSource(string, int, string) | Ctor. |
Properties
Name | Description |
---|---|
CacheKey { get; } | The key of this source in the cache. |
FilePath { get; } | Path to the font file. |
Priority { get; } | Returns the font source priority. |
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 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.That(fileFontSource.FilePath, Is.EqualTo(MyDir + "Alte DIN 1451 Mittelschrift.ttf"));
Assert.That(fileFontSource.Type, Is.EqualTo(FontSourceType.FontFile));
Assert.That(fileFontSource.Priority, Is.EqualTo(0));
See Also
- class FontSourceBase
- namespace Aspose.Words.Fonts
- assembly Aspose.Words