List all Font Families : Font « GUI Windows Forms « C# / CSharp Tutorial






List all Font Families
using System;
using System.Drawing;
using System.Windows.Forms;

public class FontFamilies : Form
{
  public FontFamilies()
  {
    Size = new Size(350,200);

    RichTextBox rtxt = new RichTextBox();
    rtxt.Multiline = true;
    rtxt.Dock = DockStyle.Fill;
    rtxt.Parent = this;

    FontFamily[] ffArray = FontFamily.Families;
    foreach( FontFamily ff in ffArray )
    {
      if (ff.IsStyleAvailable(FontStyle.Regular))
      {
        rtxt.Text += ff.Name + "\n"; 
      }
    }
  }

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








23.70.Font
23.70.1.Font Constructor: derive a fontFont Constructor: derive a font
23.70.2.RichTextBox: MultilineRichTextBox: Multiline
23.70.3.Create a font from font name and size
23.70.4.Create a font from FontFamilyCreate a font from FontFamily
23.70.5.Use GraphicsUnit to create fontUse GraphicsUnit to create font
23.70.6.List all Font FamiliesList all Font Families
23.70.7.Font PropertiesFont Properties
23.70.8.Font list formFont list form