GDI+ 如何查看电脑已经安装了多少字体。

使用
InstalledFontCollection来获得电脑已经安装的字体有哪些。如图;

 

 代码如下:

View Code
 1     //查看电脑有多少字体
 2         private void Form1_Paint(object sender, PaintEventArgs e)
 3         {
 4             FontFamily[] fontfamilys ;
 5             InstalledFontCollection installedFontCollection = new InstalledFontCollection();
 6             fontfamilys = installedFontCollection.Families;
 7             foreach (var item in fontfamilys)
 8             {
 9                 Console.WriteLine("fontname:{0}",item.Name);
10             }
11         }

 

 

posted on 2011-08-02 22:51  wtq  阅读(875)  评论(0编辑  收藏  举报