Get All Installed Fonts in C#

This class is a collection of storing all the installed fonts and enabled you to populate them via iteration.
 
To get all the installed fonts ,we need first add reference to System.Drawing and then import it in our project with using statement:
  1. using System.Drawing.Text;  
This will let us use InstalledFontCollection class:
 
Now lets build a sample.
 
Create a windows forms,add a listbox and then add these codes:
  1. using(InstalledFontCollection col = new InstalledFontCollection()) {  
  2.     foreach(FontFamily fa in col.Families) {  
  3.         listBox1.Items.Add(fa.Name);  
  4.     }  
After we run,we'll be populating them:
 
art1.png
 
Hope that helps!