Fonts.GetTypefaces Method (Uri, String)

Returns a collection of TypeFace objects using a base uniform resource identifier (URI) value to resolve the font location.

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

public static ICollection<Typeface> GetTypefaces (
	Uri baseUri,
	string location
public static ICollection<Typeface> GetTypefaces (
	Uri baseUri, 
	String location
public static function GetTypefaces (
	baseUri : Uri, 
	location : String
) : ICollection<Typeface>
You cannot use methods in XAML.



The base URI value of the location of the fonts.


The location that contains the fonts.

Return Value

An ICollection of TypeFace objects that represent the fonts in the resolved font location.

The following example shows how to use this method to return the collection of TypeFace objects from the resolved font location. In this case, the application contains a subdirectory named "resources".

foreach (Typeface typeface in Fonts.GetTypefaces(new Uri("pack://application:,,,/"), "./resources/"))
    // Perform action.

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

Community Additions