This documentation is archived and is not being maintained.
FontFamily Class
Visual Studio 2010
Defines a group of type faces having a similar basic design and certain variations in styles. This class cannot be inherited.
Assembly: System.Drawing (in System.Drawing.dll)
The FontFamily type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | FontFamily(GenericFontFamilies) | Initializes a new FontFamily from the specified generic font family. |
![]() | FontFamily(String) | Initializes a new FontFamily with the specified name. |
![]() | FontFamily(String, FontCollection) | Initializes a new FontFamily in the specified FontCollection with the specified name. |
| Name | Description | |
|---|---|---|
![]() ![]() | Families | Returns an array that contains all the FontFamily objects associated with the current graphics context. |
![]() ![]() | GenericMonospace | Gets a generic monospace FontFamily. |
![]() ![]() | GenericSansSerif | Gets a generic sans serif FontFamily object. |
![]() ![]() | GenericSerif | Gets a generic serif FontFamily. |
![]() | Name | Gets the name of this FontFamily. |
| Name | Description | |
|---|---|---|
![]() | CreateObjRef | 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 | Releases all resources used by this FontFamily. |
![]() | Equals | Indicates whether the specified object is a FontFamily and is identical to this FontFamily. (Overrides Object::Equals(Object).) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetCellAscent | Returns the cell ascent, in design units, of the FontFamily of the specified style. |
![]() | GetCellDescent | Returns the cell descent, in design units, of the FontFamily of the specified style. |
![]() | GetEmHeight | Gets the height, in font design units, of the em square for the specified style. |
![]() ![]() | GetFamilies | Obsolete. Returns an array that contains all the FontFamily objects available for the specified graphics context. |
![]() | GetHashCode | Gets a hash code for this FontFamily. (Overrides Object::GetHashCode().) |
![]() | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
![]() | GetLineSpacing | 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 | Returns the name, in the specified language, of this FontFamily. |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
![]() | IsStyleAvailable | Indicates whether the specified FontStyle enumeration is available. |
![]() | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) |
![]() | ToString | Converts this FontFamily to a human-readable string representation. (Overrides Object::ToString().) |
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.
private: 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 ); } }
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show:
