Class DWriteFont
The IDWriteFont interface represents a physical font in a font collection.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DWrite
Assembly: JeremyAnsel.DirectX.DWrite.dll
Syntax
[SecurityCritical]
public class DWriteFont : DXComObject, IDisposable
Constructors
| Edit this page View SourceDWriteFont(nint)
Initializes a new instance of the DWriteFont class.
Declaration
public DWriteFont(nint comPtr)
Parameters
| Type | Name | Description |
|---|---|---|
| nint | comPtr |
Fields
| Edit this page View SourceDWriteFontGuid
The interface GUID.
Declaration
public static readonly Guid DWriteFontGuid
Field Value
| Type | Description |
|---|---|
| Guid |
Properties
| Edit this page View SourceIsSymbolFont
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 |
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 |