FontSourceBasePriority Property

Returns the font source priority.

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

Syntax

public int Priority { get; }

Property Value

Type: Int32

Remarks

This value is used when there are fonts with the same family name and style in different font sources. In this case Aspose.Words selects the font from the source with the higher priority value.

The default value is 0.

Examples

Shows how to create a file font source.
Document doc = new Document();

// Create a font settings object for our document
doc.FontSettings = new FontSettings();

// Create a font source from a file in our system
FileFontSource fileFontSource = new FileFontSource(MyDir + "Alte DIN 1451 Mittelschrift.ttf", 0);

// Import the font source into our document
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