FontFamily FontFamily FontFamily FontFamily Class


Defines a group of type faces having a similar basic design and certain variations in styles. This class cannot be inherited.

public ref class FontFamily sealed : MarshalByRefObject, IDisposable
public sealed class FontFamily : MarshalByRefObject, IDisposable
type FontFamily = class
    inherit MarshalByRefObject
    interface IDisposable
Public NotInheritable Class FontFamily
Inherits MarshalByRefObject
Implements IDisposable


The following code example shows all the font families in the Families property of the FontFamily class. This example is designed to be used with a Windows Form. To run this example, add a ListBox named listBox1 to a form and call the PopulateListBoxWithFonts method from the form's constructor.

   void PopulateListBoxWithFonts()
      listBox1->Width = 200;
      listBox1->Location = Point(40,120);
      System::Collections::IEnumerator^ myEnum = FontFamily::Families->GetEnumerator();
      while ( myEnum->MoveNext() )
         FontFamily^ oneFontFamily = safe_cast<FontFamily^>(myEnum->Current);
         listBox1->Items->Add( oneFontFamily->Name );
private void PopulateListBoxWithFonts()
    listBox1.Width = 200;
    listBox1.Location = new Point(40, 120);
    foreach ( FontFamily oneFontFamily in FontFamily.Families )
Private Sub PopulateListBoxWithFonts()
    listBox1.Width = 200
    listBox1.Location = New Point(40, 120)
    Dim oneFontFamily As FontFamily
    For Each oneFontFamily In FontFamily.Families
End Sub


FontFamily(GenericFontFamilies) FontFamily(GenericFontFamilies) FontFamily(GenericFontFamilies) FontFamily(GenericFontFamilies)

Initializes a new FontFamily from the specified generic font family.

FontFamily(String) FontFamily(String) FontFamily(String) FontFamily(String)

Initializes a new FontFamily with the specified name.

FontFamily(String, FontCollection) FontFamily(String, FontCollection) FontFamily(String, FontCollection) FontFamily(String, FontCollection)

Initializes a new FontFamily in the specified FontCollection with the specified name.


Families Families Families Families

Returns an array that contains all the FontFamily objects associated with the current graphics context.

GenericMonospace GenericMonospace GenericMonospace GenericMonospace

Gets a generic monospace FontFamily.

GenericSansSerif GenericSansSerif GenericSansSerif GenericSansSerif

Gets a generic sans serif FontFamily object.

GenericSerif GenericSerif GenericSerif GenericSerif

Gets a generic serif FontFamily.

Name Name Name Name

Gets the name of this FontFamily.


CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Dispose() Dispose() Dispose() Dispose()

Releases all resources used by this FontFamily.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Indicates whether the specified object is a FontFamily and is identical to this FontFamily.

Finalize() Finalize() Finalize() Finalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.

GetCellAscent(FontStyle) GetCellAscent(FontStyle) GetCellAscent(FontStyle) GetCellAscent(FontStyle)

Returns the cell ascent, in design units, of the FontFamily of the specified style.

GetCellDescent(FontStyle) GetCellDescent(FontStyle) GetCellDescent(FontStyle) GetCellDescent(FontStyle)

Returns the cell descent, in design units, of the FontFamily of the specified style.

GetEmHeight(FontStyle) GetEmHeight(FontStyle) GetEmHeight(FontStyle) GetEmHeight(FontStyle)

Gets the height, in font design units, of the em square for the specified style.

GetFamilies(Graphics) GetFamilies(Graphics) GetFamilies(Graphics) GetFamilies(Graphics)

Returns an array that contains all the FontFamily objects available for the specified graphics context.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Gets a hash code for this FontFamily.

GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetLineSpacing(FontStyle) GetLineSpacing(FontStyle) GetLineSpacing(FontStyle) GetLineSpacing(FontStyle)

Returns the line spacing, in design units, of the FontFamily of the specified style. The line spacing is the vertical distance between the base lines of two consecutive lines of text.

GetName(Int32) GetName(Int32) GetName(Int32) GetName(Int32)

Returns the name, in the specified language, of this FontFamily.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
IsStyleAvailable(FontStyle) IsStyleAvailable(FontStyle) IsStyleAvailable(FontStyle) IsStyleAvailable(FontStyle)

Indicates whether the specified FontStyle enumeration is available.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
ToString() ToString() ToString() ToString()

Converts this FontFamily to a human-readable string representation.

Applies to

See also