Font.FontFamily : Font « System.Drawing « C# / C Sharp by API






Font.FontFamily

  
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            + "\n" +
                    "FontFamily: "         + Font.FontFamily      + "\n" +
                    "FontStyle: "          + Font.Style           + "\n" +
                    "Bold: "               + Font.Bold            + "\n" +
                    "Italic: "             + Font.Italic          + "\n" +
                    "Underline: "          + Font.Underline       + "\n" +
                    "Strikeout: "          + Font.Strikeout       + "\n" +
                    "Size: "               + Font.Size            + "\n" +
                    "GraphicsUnit: "       + Font.Unit            + "\n" +
                    "SizeInPoints: "       + Font.SizeInPoints    + "\n" +
                    "Height: "             + Font.Height          + "\n" +
                    "GdiCharSet: "         + Font.GdiCharSet      + "\n" +
                    "GdiVerticalFont : "   + Font.GdiVerticalFont + "\n" +
                    "GetHeight(): "        + Font.GetHeight()     + "\n" +
                    "GetHeight(grfx): "    + Font.GetHeight(grfx) + "\n" +
                    "GetHeight(100 DPI): " + Font.GetHeight(100),
                    Font, new SolidBrush(clr), Point.Empty);
     }
}

   
    
  








Related examples in the same category

1.new Font(String fontName, int size)
2.new Font("Times New Roman", 10, FontStyle.Italic)
3.Font.GetHeight
4.Font.Height
5.Font.Name
6.Font.Size
7.Font.SizeInPoints
8.Font.Unit