Export (0) Print
Expand All

FontFamily Constructor (Uri, String)

Initializes a new instance of the FontFamily class from the specified font family name and an optional base uniform resource identifier (URI) value.

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

public FontFamily(
	Uri baseUri,
	string familyName
)

Parameters

baseUri
Type: System.Uri

Specifies the base URI that is used to resolve familyName.

familyName
Type: System.String

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

The familyName value can specify a relative URI value, which requires a base URI to resolve the font reference. The baseUri value can be null.

The following code shows a font reference that is composed of a base URI value and a relative URI value.

// The font resource reference includes the base URI reference (application directory level), 
// and a relative URI reference.
myTextBlock.FontFamily = new FontFamily(new Uri("pack://application:,,,/"), "./resources/#Pericles Light");

.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