Each font in C # is represented by the fontfamily class, as follows:
fontfamily = new fontfamily ("Arial ");
Font font = new font (
fontfamily,
8,
fontstyle. regular,
graphicsunit. point);
rectanglef rectf = new rectanglef (10, 10,500,500);
solidbrush = new solidbrush (color. black);
String familyname;
String familylist = "";
Fontfamily [] fontfamilies; // defines an array of font classes for loading font information.
// Obtain all fonts installed by the system using the families attribute of the installedfontcollection class
Installedfontcollection = new installedfontcollection ();
// Get the array of fontfamily objects.
Fontfamilies = installedfontcollection. Families;
// Print the font information cyclically
Int COUNT = fontfamilies. length;
For (Int J = 0; j <count; ++ J)
{
Familyname = fontfamilies [J]. Name;
Familylist = familylist + familyname;
Familylist = familylist + ",";
}
// Draw the large string (list of all families) in a rectangle.
E. Graphics. drawstring (familylist, Font, solidbrush, rectf );