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;
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:
This will let us use InstalledFontCollection class:Now lets build a sample.
(InstalledFontCollection col =
new
InstalledFontCollection())
{
foreach
(FontFamily fa
in
col.Families)
listBox1.Items.Add(fa.Name);
}
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: