Share via


SystemFonts.GetFontByName(String) 方法

定义

返回一个对应于指定系统字体名称的字体对象。

public:
 static System::Drawing::Font ^ GetFontByName(System::String ^ systemFontName);
public static System.Drawing.Font GetFontByName (string systemFontName);
public static System.Drawing.Font? GetFontByName (string systemFontName);
static member GetFontByName : string -> System.Drawing.Font
Public Shared Function GetFontByName (systemFontName As String) As Font

参数

systemFontName
String

需要字体对象的系统字体的名称。

返回

如果指定的名称与 Font 中的值匹配,为 SystemFonts;否则为 null

注解

如果指定的名称与枚举中的SystemFonts字体不匹配,则GetFontByName方法返回 null

适用于