All font properties

image_pdfimage_print
   
 

using System;
using System.Drawing;
using System.Windows.Forms;
   
class AllAboutFont: Form
{
     public static void Main()
     {
          Application.Run(new AllAboutFont());
     }
     public AllAboutFont()
     {
          ResizeRedraw = true; 
     }
     protected override void OnPaint(PaintEventArgs pea)
     {
          DoPage(pea.Graphics, ForeColor,ClientSize.Width, ClientSize.Height);
     }     
     protected void DoPage(Graphics grfx, Color clr, int cx, int cy)
     {
          grfx.DrawString(
                    "Name: "               + Font.Name            + "
" +
                    "FontFamily: "         + Font.FontFamily      + "
" +
                    "FontStyle: "          + Font.Style           + "
" +
                    "Bold: "               + Font.Bold            + "
" +
                    "Italic: "             + Font.Italic          + "
" +
                    "Underline: "          + Font.Underline       + "
" +
                    "Strikeout: "          + Font.Strikeout       + "
" +
                    "Size: "               + Font.Size            + "
" +
                    "GraphicsUnit: "       + Font.Unit            + "
" +
                    "SizeInPoints: "       + Font.SizeInPoints    + "
" +
                    "Height: "             + Font.Height          + "
" +
                    "GdiCharSet: "         + Font.GdiCharSet      + "
" +
                    "GdiVerticalFont : "   + Font.GdiVerticalFont + "
" +
                    "GetHeight(): "        + Font.GetHeight()     + "
" +
                    "GetHeight(grfx): "    + Font.GetHeight(grfx) + "
" +
                    "GetHeight(100 DPI): " + Font.GetHeight(100),
                    Font, new SolidBrush(clr), Point.Empty);
     }
}