SystemFonts.GetFontByName Method (String)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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

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

Public Shared Function GetFontByName (
	systemFontName As String
) As Font


Type: System.String

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

Return Value

Type: System.Drawing.Font

A Font if the specified name matches a value in SystemFonts; otherwise, null.

The GetFontByName method returns null if the specified name does not match a font in the SystemFonts enumeration.

.NET Framework
Available since 2.0
Return to top