This documentation is archived and is not being maintained.

SystemFonts.GetFontByName Method

Returns a font object that corresponds to the specified system font name.

Namespace: System.Drawing
Assembly: System.Drawing (in system.drawing.dll)

public static Font GetFontByName (
	string systemFontName
)
public static Font GetFontByName (
	String systemFontName
)
public static function GetFontByName (
	systemFontName : String
) : Font
Not applicable.

Parameters

systemFontName

The name of the system font you need a font object for.

Return Value

A Font if the specified name matches a value in SystemFonts; otherwise, a null reference (Nothing in Visual Basic).

The GetFontByName method returns a null reference (Nothing in Visual Basic) if the specified name does not match a font in the SystemFonts enumeration.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, 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, 2.0
Show: