Class DWriteFont
The IDWriteFont interface represents a physical font in a font collection.
Inherited Members
Namespace: JeremyAnsel.DirectX.DWrite
Assembly: JeremyAnsel.DirectX.DWrite.dll
Syntax
public sealed class DWriteFont : 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 |
IsSymbolFont
Gets a value indicating whether the font is a symbol font.
Declaration
public bool IsSymbolFont { get; }
Property Value
Type | Description |
---|---|
bool |
Simulations
Gets a value that indicates what simulation are applied to the specified font.
Declaration
public DWriteFontSimulations Simulations { get; }
Property Value
Type | Description |
---|---|
DWriteFontSimulations |
Stretch
Gets the stretch (aka. width) of the specified font.
Declaration
public DWriteFontStretch Stretch { get; }
Property Value
Type | Description |
---|---|
DWriteFontStretch |
Style
Gets the style (aka. slope) of the specified font.
Declaration
public DWriteFontStyle Style { get; }
Property Value
Type | Description |
---|---|
DWriteFontStyle |
Weight
Gets the weight of the specified font.
Declaration
public DWriteFontWeight Weight { get; }
Property Value
Type | Description |
---|---|
DWriteFontWeight |
Methods
| Edit this page View SourceCreateFontFace()
Creates a font face object for the font.
Declaration
public DWriteFontFace CreateFontFace()
Returns
Type | Description |
---|---|
DWriteFontFace |
Dispose()
Immediately releases the unmanaged resources used by the DWrite object.
Declaration
public void Dispose()
GetFaceNames()
Gets a localized strings collection containing the face names for the font (e.g., Regular or Bold), indexed by locale name.
Declaration
public DWriteLocalizedStrings GetFaceNames()
Returns
Type | Description |
---|---|
DWriteLocalizedStrings |
GetFontFamily()
Gets the font family to which the specified font belongs.
Declaration
public DWriteFontFamily GetFontFamily()
Returns
Type | Description |
---|---|
DWriteFontFamily |
GetInformationalStrings(DWriteInformationalStringId)
Gets a localized strings collection containing the specified informational strings, indexed by locale name.
Declaration
public DWriteLocalizedStrings GetInformationalStrings(DWriteInformationalStringId informationalStringId)
Parameters
Type | Name | Description |
---|---|---|
DWriteInformationalStringId | informationalStringId | Identifies the string to get. |
Returns
Type | Description |
---|---|
DWriteLocalizedStrings |
Remarks
If the font does not contain the specified string, the return value is S_OK but informationalStrings receives a NULL pointer and exists receives the value FALSE.
GetMetrics()
Gets the metrics for the font.
Declaration
public DWriteFontMetrics GetMetrics()
Returns
Type | Description |
---|---|
DWriteFontMetrics |
HasCharacter(uint)
Determines whether the font supports the specified character.
Declaration
public bool HasCharacter(uint unicodeValue)
Parameters
Type | Name | Description |
---|---|---|
uint | unicodeValue | Unicode (UCS-4) character value. |
Returns
Type | Description |
---|---|
bool |
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(DWriteFont)
Gets a boolean indicating if the handle is not null.
Declaration
public static implicit operator bool(DWriteFont value)
Parameters
Type | Name | Description |
---|---|---|
DWriteFont | value | A DWrite object. |
Returns
Type | Description |
---|---|
bool | A boolean |