ARTICLE

Get All Installed Fonts in C#

Posted by Ibrahim Ersoy Articles | .NET Assemblies July 09, 2012
If you need to retrieve all the fonts installed on your environment,you just need InstalledFontCollection class.
Reader Level:
Download Files:
 

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:


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:


using (InstalledFontCollection col = new InstalledFontCollection())
{
foreach (FontFamily fa in col.Families)
{
listBox1.Items.Add(fa.Name);
}
} After we run,we'll be populating them:

art1.png Hope that helps!

Login to add your contents and source code to this article
post comment
     
COMMENT USING
PREMIUM SPONSORS
DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and add new content to existing PDF documents from within your applications.
SPONSORED BY
  • PDF reports have never been easier to create. With our included WYSIWYG Designer, you can layout your reports, set up your data source and let DynamicPDF ReportWriter do the rest.