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

Represents a family of related fonts.

Definition

Namespace:Telerik.WinControls.RichTextEditor.UI

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

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

Inheritance: objectFontFamily

Derived Classes: FontFamilyInfo

Constructors

Initializes a wrapper without an underlying GDI+ font family.

C#
public FontFamily()

Reading Source or calling ToString() or GetHashCode() throws a NullReferenceException. Calling Equals(object) with another FontFamily also throws. Conversion to FontFamily returns null.

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

C#
public FontFamily(string familyName)
Parameters:familyNamestring

The requested font family name.

Exceptions: ArgumentNullException

familyName cannot be null.

The name is resolved against theme-loaded and installed fonts. If neither contains an exact match, the font fallback mapping is used; if that lookup fails, Verdana is used. The name "Portable User Interface" selects the WinForms default font family. A comma-separated value is not treated as an ordered list of alternative family names.

Properties

Gets the resolved GDI+ font-family name backing this wrapper.

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

The name of the underlying FontFamily.

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 resolved font-family name represented by this wrapper, without font-style information.

Overrides: object.ToString()

Operators

Converts this wrapper to its underlying GDI+ font family.

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

The wrapper whose underlying font family is returned.

Returns:

FontFamily

The underlying GDI+ font family, or null if family was created with the parameterless constructor.

Exceptions: NullReferenceException

family is null.