Using Fonts and Text

There are several classes offered by GDI+ and GDI for drawing text on Windows Forms. The GDI+ Graphics class has several DrawString methods that allow you to specify various features of text, such as location, bounding rectangle, font, and format. In addition, you can draw and measure text with GDI using the static DrawText and MeasureText methods offered by the TextRenderer class. The GDI methods also allow you to specify location, font, and format. You can choose either GDI or GDI+ for text rendering; however, GDI generally offers better performance and more accurate text measuring. Other classes that contribute to text rendering include FontFamily, Font, StringFormat, and TextFormatFlags.

In This Section

Reference

  • Font
    Describes this class and contains links to all of its members.

  • FontFamily
    Describes this class and contains links to all of its members.

  • PrivateFontCollection
    Describes this class and contains links to all of its members.

  • TextRenderer
    Describes this class and contains links to all of its members.

  • TextFormatFlags
    Describes this class and contains links to all of its members.