FileFontSource class

Represents the single TrueType font file stored in the file system.

public class FileFontSource : FontSourceBase


Name Description
FileFontSource(string) Ctor.
FileFontSource(string, int) Ctor.
FileFontSource(string, int, string) Ctor.


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.


Name Description
GetAvailableFonts() Returns list of fonts available via this source.


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);

See Also