Class DWriteFontCollection
The DWriteFontCollection encapsulates a collection of fonts.
Inherited Members
Namespace: JeremyAnsel.DirectX.DWrite
Assembly: JeremyAnsel.DirectX.DWrite.dll
Syntax
public sealed class DWriteFontCollection : IDisposable, IDWriteReleasable
Properties
| Edit this page View SourceHandle
Gets an handle representing the DWrite object interface.
Declaration
public object Handle { get; }
Property Value
Type | Description |
---|---|
object |
Methods
| Edit this page View SourceDispose()
Immediately releases the unmanaged resources used by the DWrite object.
Declaration
public void Dispose()
FindFontFamily(string, out uint)
Finds the font family with the specified family name.
Declaration
public bool FindFontFamily(string familyName, out uint index)
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. |
uint | index | Receives the zero-based index of the matching font family if the family name was found or UINT_MAX otherwise. |
Returns
Type | Description |
---|---|
bool | 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.
Release()
Releases the managed reference to the COM DWrite interface.
Declaration
public void Release()
ToBoolean()
Gets a boolean indicating if the handle is not null.
Declaration
public bool ToBoolean()
Returns
Type | Description |
---|---|
bool | A boolean |
Operators
| Edit this page View Sourceimplicit operator bool(DWriteFontCollection)
Gets a boolean indicating if the handle is not null.
Declaration
public static implicit operator bool(DWriteFontCollection value)
Parameters
Type | Name | Description |
---|---|---|
DWriteFontCollection | value | A DWrite object. |
Returns
Type | Description |
---|---|
bool | A boolean |