Export (0) Print
Expand All

FontFamily Constructor (String)

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

Namespace:  System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

public FontFamily(
	string familyName
)

Parameters

familyName
Type: System.String

The family name or names that comprise the new FontFamily. Multiple family names should be separated by commas.

ExceptionCondition
ArgumentNullException

familyName cannot be null.

Each family name that is specified in the familyName parameter can be preceded by a location reference to either a directory or a uniform resource identifier (URI). The location reference is separated from the family name by a pound (#) character. Multiple family names that are specified in the familyName parameter must be separated by commas.

Each family can be a real font that directly represents a set of font files that share the same family name, or can be a reference to a family name that is defined in a composite font file.

When multiple families are identified, the second and subsequent font families serve as fallback families, handling code points that are not supported by the first font family. For every code point that is not supported by the first font family, each subsequent family is checked in turn.

// Return the font family using an implied reference for a font in the default system font directory.
FontFamily fontFamily1 = new FontFamily("Arial Narrow");

// Return the font family using a directory reference for the font name.
FontFamily fontFamily2 = new FontFamily("C:/MyFonts/#Pericles Light");

// Return the font family using a URI reference for the font name.
FontFamily fontFamily3 = new FontFamily("file:///C:\\Windows\\Fonts\\#Palatino Linotype");

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft