C#读取系统安装的字体的方法
2016-08-02 16:02
429 查看
C#读取系统安装字体的方法:
//方法1 FontFamily所在命名空间为 using System.Drawing;
public List<string> GetSystemFont1()
{
List<string> fontList = new List<string>();
foreach (FontFamily font in FontFamily.Families)
{
fontList.Add(font.Name);
}
return fontList;
}
//方法2 InstalledFontCollection所在命名空间为 using System.Drawing.Text;
public List<string> GetSystemFont2()
{
InstalledFontCollection ifc = new InstalledFontCollection();
List<string> fontList = new List<string>();
foreach (FontFamily ff in ifc.Families)
{
fontList.Add(ff.Name);
}
return fontList;
}
//方法1 FontFamily所在命名空间为 using System.Drawing;
public List<string> GetSystemFont1()
{
List<string> fontList = new List<string>();
foreach (FontFamily font in FontFamily.Families)
{
fontList.Add(font.Name);
}
return fontList;
}
//方法2 InstalledFontCollection所在命名空间为 using System.Drawing.Text;
public List<string> GetSystemFont2()
{
InstalledFontCollection ifc = new InstalledFontCollection();
List<string> fontList = new List<string>();
foreach (FontFamily ff in ifc.Families)
{
fontList.Add(ff.Name);
}
return fontList;
}
相关文章推荐
- C#线程同步
- C# yield关键字 操作集合
- c#的第9结课
- C#新手入门代码 圆周率 π的表示
- C#密码修改及验证
- C#新手入门代码 类的字段没有标明 公私有,字段默认是私有
- C#新手入门代码 控制台使用console.read读入一个字符
- C#新手入门代码 一个数的开方与几次方
- C#新手入门代码 类的函数成员的参数是类自己的实例(很有趣的例子)
- C#新手入门代码 知道类实例化的个数
- C#新手入门代码 用构造函数初始化readonly字段
- C#对List中的数据进行取交集、并集、差集和去重操作的方法
- 遥感与GIS(c#编写)
- c# as
- C#操作符??和?:
- 转载:C# this.Invoke()的作用与用法 理解三
- 转载:C#中的Invoke理解一
- [置顶] C#中的反射Reflection动态加载引用
- C# Backgroundworker(后台线程)的使用
- 基于InstallShield2013LimitedEdition的安装包制作