MemoryFontSource Class |
Namespace: Aspose.Words.Fonts
The MemoryFontSource type exposes the following members.
Name | Description | |
---|---|---|
![]() ![]() | MemoryFontSource(Byte) |
Ctor.
|
![]() ![]() | MemoryFontSource(Byte, Int32) |
Ctor.
|
Name | Description | |
---|---|---|
![]() ![]() | FontData |
Binary font data.
|
![]() ![]() | Priority |
Returns the font source priority.
(Inherited from FontSourceBase.) |
![]() ![]() | Type |
Returns the type of the font source.
(Overrides FontSourceBaseType.) |
Name | Description | |
---|---|---|
![]() | Equals | (Inherited from Object.) |
![]() ![]() | GetAvailableFonts |
Returns list of fonts available via this source.
(Inherited from FontSourceBase.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | ToString | (Inherited from Object.) |
Document doc = new Document(); // Create a font settings object for our document doc.FontSettings = new FontSettings(); // Import a font file, putting its contents into a byte array byte[] fontBytes = File.ReadAllBytes(MyDir + "Alte DIN 1451 Mittelschrift.ttf"); // Create a memory font source from our array MemoryFontSource memoryFontSource = new MemoryFontSource(fontBytes, 0); // Add that font source to our document doc.FontSettings.SetFontsSources(new FontSourceBase[] { memoryFontSource }); Assert.AreEqual(52208, memoryFontSource.FontData.Length); Assert.AreEqual(FontSourceType.MemoryFont, memoryFontSource.Type); Assert.AreEqual(0, memoryFontSource.Priority);