I notice that when we are trying to list fonts using C#, that it works fine; however, if we are to install a new font while the application is running, calling the enumeration of fonts doesn't return the new font, until the application is restarted.
Here's the code:
public void Populate(bool b)
{
both = b;
foreach (FontFamily ff in FontFamily.Families)
{
if(ff.IsStyleAvailable(FontStyle.Regular))
Items.Add(ff.Name);
}
}
Notes for the above method:
Items.Add()
is adding items to a comboBox
.
I must be understanding something incorrectly here. How can i get the above code to requery the system for the fonts, even the new ones?