Fonts.GetFontFamilies Method (Uri, String)

Returns a collection of FontFamily 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<FontFamily> GetFontFamilies (
	Uri baseUri,
	string location
public static ICollection<FontFamily> GetFontFamilies (
	Uri baseUri, 
	String location
public static function GetFontFamilies (
	baseUri : Uri, 
	location : String
) : ICollection<FontFamily>
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 FontFamily objects that represent the fonts in the resolved font location.

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

foreach (FontFamily fontFamily in Fonts.GetFontFamilies(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