Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
FontFamily Class
Collapse the table of content
Expand the table of content

FontFamily Class

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

Namespace:  System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)

[<Sealed>]
type FontFamily =  
    class 
        inherit MarshalByRefObject 
        interface IDisposable 
    end

The FontFamily type exposes the following members.

  NameDescription
Public methodFontFamily(GenericFontFamilies)Initializes a new FontFamily from the specified generic font family.
Public methodFontFamily(String)Initializes a new FontFamily with the specified name.
Public methodFontFamily(String, FontCollection)Initializes a new FontFamily in the specified FontCollection with the specified name.
Top

  NameDescription
Public propertyStatic memberFamiliesReturns an array that contains all the FontFamily objects associated with the current graphics context.
Public propertyStatic memberGenericMonospaceGets a generic monospace FontFamily.
Public propertyStatic memberGenericSansSerifGets a generic sans serif FontFamily object.
Public propertyStatic memberGenericSerifGets a generic serif FontFamily.
Public propertyNameGets the name of this FontFamily.
Top

  NameDescription
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public methodDisposeReleases all resources used by this FontFamily.
Public methodEqualsIndicates whether the specified object is a FontFamily and is identical to this FontFamily. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Overrides Object.Finalize().)
Public methodGetCellAscentReturns the cell ascent, in design units, of the FontFamily of the specified style.
Public methodGetCellDescentReturns the cell descent, in design units, of the FontFamily of the specified style.
Public methodGetEmHeightGets the height, in font design units, of the em square for the specified style.
Public methodStatic memberGetFamilies Obsolete. Returns an array that contains all the FontFamily objects available for the specified graphics context.
Public methodGetHashCodeGets a hash code for this FontFamily. (Overrides Object.GetHashCode().)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public methodGetLineSpacingReturns 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.
Public methodGetNameReturns the name, in the specified language, of this FontFamily.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public methodIsStyleAvailableIndicates whether the specified FontStyle enumeration is available.
Public methodToStringConverts this FontFamily to a human-readable string representation. (Overrides Object.ToString().)
Top

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.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2015 Microsoft