Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FontFamily.FontFamily(Uri, String) Constructor

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
)
public FontFamily (
	Uri baseUri, 
	String familyName
)
public function FontFamily (
	baseUri : Uri, 
	familyName : String
)
You cannot use constructors in XAML.

Parameters

baseUri

Specifies the base URI that is used to resolve familyName.

familyName

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 a null reference (Nothing in Visual Basic).

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");

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft