FontFamily Constructor (Uri, String)
.NET Framework 3.5
Initializes a new instance of the FontFamily class from the specified font family name and an optional base uniform resource identifier (URI) value.
Assembly: PresentationCore (in PresentationCore.dll)
'Declaration Public Sub New ( _ baseUri As Uri, _ familyName As String _ ) 'Usage Dim baseUri As Uri Dim familyName As String Dim instance As New FontFamily(baseUri, _ familyName)
You cannot use constructors in XAML.
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 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 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.