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






Font.Unit

  

using System;
using System.Drawing;
using System.Windows.Forms;

public class FontConstructor3 : Form
{
  public FontConstructor3()
  {
        Text = "Font Constructor";
    Size = new Size(350,200);

    FontFamily ff = new FontFamily("Times New Roman");
    Font fnt = new Font(ff, 12, FontStyle.Bold | FontStyle.Italic);
    Font = fnt;

    RichTextBox rtxt = new RichTextBox();
    rtxt.Text = "first line.\n" +
          "This is a second line of text.";
    rtxt.Text += "\nFont Name:\t" + Font.Name;
    rtxt.Text += "\nFont Family:\t" + Font.FontFamily;
    rtxt.Text += "\nFont Styles:\t" + Font.Style;
    rtxt.Text += "\nFont Size:\t" + Font.Size;
    rtxt.Text += "\nFont Height:\t" + Font.Height;
    rtxt.Text += "\nFont Units:\t" + Font.Unit;
    rtxt.Multiline = true;
    rtxt.Dock = DockStyle.Fill;
    rtxt.Parent = this;
  }

  static void Main() 
  {
    Application.Run(new FontConstructor3());
  }

}

   
    
  








Related examples in the same category

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