FontFamily
Namespace: System.Drawing
Assembly: System.Drawing.Managed (4.0.0.0)
Defines a group of type faces having a similar basic design and certain variations in styles. This class cannot be inherited.
- C#
- VB.NET
public class FontFamily : MarshalByRefObject, IDisposable
Public Class FontFamily
Inherits MarshalByRefObject
Implements IDisposable
Constructors
FontFamily(name)
Initializes a new instance of the FontFamily class.
| Name | Type | Description |
|---|---|---|
| name | String | The name of the new FontFamily. |
FontFamily(name, fontCollection)
Initializes a new instance of the FontFamily class from the specified generic font family.
| Name | Type | Description |
|---|---|---|
| name | String | |
| fontCollection | FontCollection |
FontFamily(genericFamily)
Initializes a new instance of the FontFamily class from the specified generic font family.
| Name | Type | Description |
|---|---|---|
| genericFamily | GenericFontFamilies | The GenericFontFamilies from which to create the new FontFamily. |
Properties
Families
FontFamily[]: Gets an array that contains all the FontFamily objects associated with the current graphics context.
GenericMonospace
FontFamily: Gets a generic monospace FontFamily.
GenericSansSerif
FontFamily: Gets a generic sans serif FontFamily object.
GenericSerif
FontFamily: Gets a generic serif FontFamily.
Name
String: Gets the name of this FontFamily.
Methods
Dispose()
GetCellAscent(style)
Returns the cell ascent, in design units, of the FontFamily of the specified style.
| Parameter | Type | Description |
|---|---|---|
| style | FontStyle | A FontStyle that contains style information for the font. |
Returns: Int32. The cell ascent for this FontFamily that uses the specified FontStyle.
GetCellDescent(style)
Returns the cell descent, in design units, of the FontFamily of the specified style.
| Parameter | Type | Description |
|---|---|---|
| style | FontStyle | A FontStyle that contains style information for the font. |
Returns: Int32. The cell descent for this FontFamily that uses the specified FontStyle.
GetEmHeight(style)
Returns the height, in design units, of the FontFamily of the specified style.
| Parameter | Type | Description |
|---|---|---|
| style | FontStyle | A FontStyle that contains style information for the font. |
Returns: Int32. The height for this FontFamily that uses the specified FontStyle.
GetLineSpacing(style)
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.
| Parameter | Type | Description |
|---|---|---|
| style | FontStyle | The FontStyle to apply. |
Returns: Int32. The distance between two consecutive lines of text.
GetName(language)
Returns the name, in the specified language, of this FontFamily.
| Parameter | Type | Description |
|---|---|---|
| language | Int32 | The language in which the name is returned. |
Returns: String. A String that represents the name, in the specified language, of this FontFamily.
IsStyleAvailable(style)
Indicates whether the specified FontStyle enumeration is available.
| Parameter | Type | Description |
|---|---|---|
| style | FontStyle | The FontStyle to test. |
Returns: Boolean. if the specified FontStyle is available; otherwise, .