Class DWriteFontCollection
The DWriteFontCollection encapsulates a collection of fonts.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DWrite
Assembly: JeremyAnsel.DirectX.DWrite.dll
Syntax
[SecurityCritical]
public class DWriteFontCollection : DXComObject, IDisposable
Constructors
| Edit this page View SourceDWriteFontCollection(nint)
Initializes a new instance of the DWriteFontCollection class.
Declaration
public DWriteFontCollection(nint comPtr)
Parameters
| Type | Name | Description |
|---|---|---|
| nint | comPtr |
Fields
| Edit this page View SourceDWriteFontCollectionGuid
The interface GUID.
Declaration
public static readonly Guid DWriteFontCollectionGuid
Field Value
| Type | Description |
|---|---|
| Guid |
Methods
| Edit this page View SourceFindFontFamily(ReadOnlySpan<char>)
Finds the font family with the specified family name.
Declaration
public uint FindFontFamily(ReadOnlySpan<char> familyName)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<char> | familyName | Name of the font family. The name is not case-sensitive but must otherwise exactly match a family name in the collection. |
Returns
| Type | Description |
|---|---|
| uint | TRUE if the family name exists or FALSE otherwise. |
FindFontFamily(string)
Finds the font family with the specified family name.
Declaration
public uint FindFontFamily(string familyName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | familyName | Name of the font family. The name is not case-sensitive but must otherwise exactly match a family name in the collection. |
Returns
| Type | Description |
|---|---|
| uint | TRUE if the family name exists or FALSE otherwise. |
GetFontFamily(uint)
Creates a font family object given a zero-based font family index.
Declaration
public DWriteFontFamily GetFontFamily(uint index)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | index | Zero-based index of the font family. |
Returns
| Type | Description |
|---|---|
| DWriteFontFamily |
GetFontFamilyCount()
Gets the number of font families in the collection.
Declaration
public uint GetFontFamilyCount()
Returns
| Type | Description |
|---|---|
| uint |
GetFontFromFontFace(DWriteFontFace?)
Gets the font object that corresponds to the same physical font as the specified font face object. The specified physical font must belong to the font collection.
Declaration
public DWriteFont GetFontFromFontFace(DWriteFontFace? fontFace)
Parameters
| Type | Name | Description |
|---|---|---|
| DWriteFontFace | fontFace | Font face object that specifies the physical font. |
Returns
| Type | Description |
|---|---|
| DWriteFont |
Remarks
If the specified physical font is not part of the font collection the return value is DWRITE_E_NOFONT.