获得系统中安装的字体

  using System.Drawing;   
  using System.Drawing.Text;     
   .....       
  //load the installed fonts and iterate through the collections   
  InstalledFontCollection fonts new InstalledFontCollection();   
  foreach(FontFamily family in fonts.Families)  //FontFamily.Families   
    
     //ensure font supports regular,bolding,underlining,and italics   
     if(family.IsStyleAvailable(FontStyle.Regular & FontStyle.Bold    
            FontStyle.Italic & FontStyle.Underline))
       
         //Add font name to your list   
         this.yourList.Items.Add(family.Name); 
      
   }
posted @ 2009-12-03 22:57    阅读(177)  评论(0编辑  收藏  举报