New to Telerik UI for WinForms? Start a free 30-day trial

Represents a family of related fonts.

Definition

Namespace:Telerik.WinControls.Spreadsheet.UI

Assembly:Telerik.WinControls.RadSpreadsheet.dll

Syntax:

C#
[TypeConverter(typeof(FontFamilyConverter))]
public class FontFamily

Inheritance: objectFontFamily

Constructors

Creates a font-family wrapper without an underlying GDI+ font family.

C#
public FontFamily()

Members that access the underlying font family, such as Source and ToString(), cannot be used until a family is initialized; this type exposes no setter to initialize one.

Initializes a new instance of the FontFamily class from the specified font family name.

C#
public FontFamily(string familyName)
Parameters:familyNamestring

A GDI+ font family name. This compatibility implementation does not resolve a comma-separated fallback list.

Exceptions: ArgumentNullException

familyName cannot be null.

An unrecognized family name silently falls back to Verdana. The name Portable User Interface maps to the current WinForms default font family.

Properties

Gets the font family name that is used to construct the FontFamily object.

C#
public string Source { get; }
Property Value:

The font family name of the FontFamily object.

Methods

Gets a value that indicates whether the current font family object and the specified font family object are the same.

C#
public override bool Equals(object o)
Parameters:oobject

The FontFamily object to compare.

Returns:

bool

true if o is equal to the current FontFamily object; otherwise, false. If o is not a FontFamily object, false is returned.

Overrides: object.Equals(object)

Serves as a hash function for FontFamily. It is suitable for use in hashing algorithms and data structures such as a hash table.

C#
public override int GetHashCode()
Returns:

int

An int value that represents the hash code for the current object.

Overrides: object.GetHashCode()

Returns the name of the underlying GDI+ font family.

C#
public override string ToString()
Returns:

string

The backing family's name.

Overrides: object.ToString()

Operators

Gets the backing GDI+ font family from a compatibility font-family value.

C#
public static implicit operator FontFamily(FontFamily family)
Parameters:familyFontFamily

The compatibility font family.

Returns:

FontFamily

The underlying FontFamily; it is null for an uninitialized instance.