C#怎么获取windows系统支持的字体以及字体样式
编程开发
C#windows字体字体样式
首先引用 System.Drawing.dll
代码如下:
//如何获得系统字体列表
System.Drawing.Text.InstalledFontCollection fonts = new System.Drawing.Text.InstalledFontCollection();
///字体列表
List<System.Drawing.FontFamily> FontFamilys = new List<System.Drawing.FontFamily>();
foreach (System.Drawing.FontFamily family in fonts.Families)
{
FontFamilys.Add(family);
}
///字体样式列表
List<string> FontStyles = new List<string>();