您的位置:首页 > 编程语言 > C#

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;

        }
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: