Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Windows font WinForm
Hi,
 
Can we show/hide installed fonts in Windows OS using C# in Windows Forms
Is there any class through which we can access a font say "Arial" and hide/show it.
 
We can manually show/hide a font by right click on the font in the Windows fonts folder
Posted 5-Dec-12 20:24pm
Comments
John d. Bartels at 15-Dec-12 12:08pm
   
There is a "FontDialog" class that will show the installed fonts

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I don't know if I understand your question right.
If you just want to get the installed fonts, there is a class "InstalledFontCollection" derieved from "FontCollection"
 
string familyName;
string familyList = "";
FontFamily[] fontFamilies;
 
InstalledFontCollection installedFontCollection = new InstalledFontCollection();
 
// Get the array of FontFamily objects.
fontFamilies = installedFontCollection.Families;
 
// The loop below creates a large string that is a comma-separated
// list of all font family names.

int count = fontFamilies.Length;
for (int j = 0; j < count; ++j)
{
    familyName = fontFamilies[j].Name;
    familyList = familyList + familyName;
    familyList = familyList + ",";
}
 
Hope this is what you wanted to know.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.150301.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100