Class DWriteFontFamily
The IDWriteFontFamily interface represents a set of fonts that share the same design but are differentiated by weight, stretch, and style.
Inherited Members
Namespace: JeremyAnsel.DirectX.DWrite
Assembly: JeremyAnsel.DirectX.DWrite.dll
Syntax
public sealed class DWriteFontFamily : 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()
  GetFamilyNames()
Creates a localized strings object that contains the family names for the font family, indexed by locale name.
Declaration
public DWriteLocalizedStrings? GetFamilyNames()
  Returns
| Type | Description | 
|---|---|
| DWriteLocalizedStrings | 
GetFirstMatchingFont(DWriteFontWeight, DWriteFontStretch, DWriteFontStyle)
Gets the font that best matches the specified properties.
Declaration
public DWriteFont? GetFirstMatchingFont(DWriteFontWeight weight, DWriteFontStretch stretch, DWriteFontStyle style)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DWriteFontWeight | weight | Requested font weight.  | 
      
| DWriteFontStretch | stretch | Requested font stretch.  | 
      
| DWriteFontStyle | style | Requested font style.  | 
      
Returns
| Type | Description | 
|---|---|
| DWriteFont | 
GetFont(uint)
Gets a font given its zero-based index.
Declaration
public DWriteFont? GetFont(uint index)
  Parameters
| Type | Name | Description | 
|---|---|---|
| uint | index | Zero-based index of the font in the font list.  | 
      
Returns
| Type | Description | 
|---|---|
| DWriteFont | 
GetFontCollection()
Gets the font collection that contains the fonts.
Declaration
public DWriteFontCollection? GetFontCollection()
  Returns
| Type | Description | 
|---|---|
| DWriteFontCollection | 
GetFontCount()
Gets the number of fonts in the font list.
Declaration
public uint GetFontCount()
  Returns
| Type | Description | 
|---|---|
| uint | 
GetMatchingFonts(DWriteFontWeight, DWriteFontStretch, DWriteFontStyle)
Gets a list of fonts in the font family ranked in order of how well they match the specified properties.
Declaration
public DWriteFontList? GetMatchingFonts(DWriteFontWeight weight, DWriteFontStretch stretch, DWriteFontStyle style)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DWriteFontWeight | weight | Requested font weight.  | 
      
| DWriteFontStretch | stretch | Requested font stretch.  | 
      
| DWriteFontStyle | style | Requested font style.  | 
      
Returns
| Type | Description | 
|---|---|
| DWriteFontList | 
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(DWriteFontFamily?)
Gets a boolean indicating if the handle is not null.
Declaration
public static implicit operator bool(DWriteFontFamily? value)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DWriteFontFamily | value | A DWrite object.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | A boolean  |