|
|
[C#]
InstalledFontCollection ifc = new InstalledFontCollection();
const double fontSize = 18;
using (Bitmap bm = new Bitmap(480, 640)) {
using (Graphics g = Graphics.FromImage(bm)) {
PointF pos = new PointF(fontSize, fontSize);
for (int i = 0; i < ifc.Families.Length; i += 10) {
FontFamily family = ifc.Families[i];
if (!family.IsStyleAvailable(FontStyle.Regular))
continue;
g.DrawString(family.Name, new Font(family, fontSize), Brushes.Black, pos.X, pos.Y);
pos += new PointF(0, fontSize * 1.5);
if (pos.Y + fontSize > bm.Height)
break;
}
bm.Save(Server.MapPath("IG88_XSettings_Fonts.jpg"));
}
}
Sample files are shown below.

IG88_XSettings_Fonts.jpg
|