--- title: "How to: Construct Font Families and Fonts" ms.date: "03/30/2017" dev_langs: - "csharp" - "vb" helpviewer_keywords: - "font families [Windows Forms], constructing" - "fonts [Windows Forms], constructing" ms.assetid: d3a4a223-9492-4b54-9afd-db1c31c3cefd --- # How to: Construct Font Families and Fonts GDI+ groups fonts with the same typeface but different styles into font families. For example, the Arial font family contains the following fonts: - Arial Regular - Arial Bold - Arial Italic - Arial Bold Italic GDI+ uses four styles to form families: regular, bold, italic, and bold italic. Adjectives such as *narrow* and *rounded* are not considered styles; rather they are part of the family name. For example, Arial Narrow is a font family with the following members: - Arial Narrow Regular - Arial Narrow Bold - Arial Narrow Italic - Arial Narrow Bold Italic Before you can draw text with GDI+, you need to construct a object and a object. The object specifies the typeface (for example, Arial), and the object specifies the size, style, and units. ## Example The following example constructs a regular style Arial font with a size of 16 pixels. In the following code, the first argument passed to the constructor is the object. The second argument specifies the size of the font measured in units identified by the fourth argument. The third argument identifies the style. is a member of the enumeration, and is a member of the enumeration. [!code-csharp[System.Drawing.FontsAndText#61](~/samples/snippets/csharp/VS_Snippets_Winforms/System.Drawing.FontsAndText/CS/Class1.cs#61)] [!code-vb[System.Drawing.FontsAndText#61](~/samples/snippets/visualbasic/VS_Snippets_Winforms/System.Drawing.FontsAndText/VB/Class1.vb#61)] ## Compiling the Code The preceding example is designed for use with Windows Forms, and it requires `e`, which is a parameter of . ## See also - [Using Fonts and Text](using-fonts-and-text.md) - [Graphics and Drawing in Windows Forms](graphics-and-drawing-in-windows-forms.md)