Getting Windows installed fonts using .NET

.NET Framework 2.0 namespaces System.Drawing and System.Drawing.Text contains many useful classes related to Drawing manipulation. These classes deals with fonts, fonts families, colors, images and bitmaps and can be used to add drawing related features in your .NET applications. One of the common task developers needs to perform in day to day .NET applications is to get the list of installed fonts in Windows operating system.

Windows Installed Fonts

Following tutorial demonstrates how you can achieve this by using .NET built in classes.


Dim fontsCollection As New InstalledFontCollection()
Dim fontFamilies As FontFamily() = fontsCollection.Families
Dim count As Integer = fontFamilies.Length

Me.Text = "Number of fonts:" + count

For Each font As FontFamily In fontFamilies


InstalledFontCollection fontsCollection = new InstalledFontCollection();
FontFamily[] fontFamilies = fontsCollection.Families;
int count = fontFamilies.Length;

this.Text = "Number of fonts:" + count;

foreach (FontFamily font in fontFamilies)



About author

User avatar

Waqas Anwar

Founder of, Senior Consultant, Microsoft .NET and Web Technologies