Class FontCollection
Represents a collection of FontFamily objects.
Implements
Inherited Members
Namespace: DRIT.Drawing.Text
Assembly: DRIT.Drawing.dll
Syntax
public abstract class FontCollection : IDisposable
Constructors
FontCollection()
Initializes a empty FontCollection instance.
Declaration
protected FontCollection()
Properties
Families
Gets the array of font families in this collection.
Declaration
public FontFamily[] Families { get; }
Property Value
| Type | Description |
|---|---|
| FontFamily[] |
Methods
AddFaces(FontFaceCollection)
Merges every face in a loaded font collection into this FontCollection as FontFamily entries.
Declaration
protected void AddFaces(FontFaceCollection collection)
Parameters
| Type | Name | Description |
|---|---|---|
| FontFaceCollection | collection | The loaded font faces. |
AddFacesFromSource(IStreamSource)
Loads every face from a font collection file (single font or TTC) and merges the resulting families into this collection.
Declaration
protected void AddFacesFromSource(IStreamSource source)
Parameters
| Type | Name | Description |
|---|---|---|
| IStreamSource | source | The stream source pointing at the font file. |
AddOrMergeFamily(FontFamily)
Adds or merges a font family into this collection.
Declaration
protected void AddOrMergeFamily(FontFamily family)
Parameters
| Type | Name | Description |
|---|---|---|
| FontFamily | family | The font family to add or merge. |
Dispose()
Releases resources used by the FontCollection.
Declaration
public virtual void Dispose()
FindFamily(string)
Tries to find a font family by name in this collection.
Declaration
public FontFamily? FindFamily(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The case-insensitive family name to look up. |
Returns
| Type | Description |
|---|---|
| FontFamily | The matching FontFamily cloned from the collection, or
|