OpenTypeFontCollection
Represents an OpenType font collection.
public class OpenTypeFontCollection
Inheritance: ObjectOpenTypeFontCollection
Licensing Info
This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to use the True Type Font Collection(TTC) font file.using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.Text;
public class Example
{
public static void CreatePDF(string outputPath, string fontCollectionPath)
{
// Create a PDF Document
Document document = new Document();
// Create a new Page
Page page = new Page();
// Add the page to the document
document.Pages.Add(page);
//Create a TextArea
TextArea area = new TextArea("Hello TTC Testing", 100, 100, 100, 100);
//Create a open type font collection.
OpenTypeFontCollection collection = new OpenTypeFontCollection(fontCollectionPath);
//Assign opentype font to label from Collection using the Index
area.Font = collection.GetFont(3);
// Add label to the page
page.Elements.Add(area);
// Save the PDF document
document.Draw(outputPath);
}
}
Constructors
OpenTypeFontCollection(Stream) | Intializes a new instance of OpenTypeFont class. |
OpenTypeFontCollection(String) | Initializes a new instance of OpenTypeFontCollection class. |
Methods
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetFont(Int32) | Gets the font from the Open type collection based on the index. |
GetFont(String) | Gets the font from the Open type collection based on the font name. |
GetFontNames() | Gets the names of the fonts present in the open type collection. |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |