6. Drawing Text

PROBABLY THE MOST USEFUL THING to draw in any application is text. Sometimes, you draw text yourself and, sometimes, text is drawn for you by the controls you're using. No matter who does the drawing, you can often specify the font, and that's what the first part of this chapter is about. The second part deals with drawing text yourself into a Graphics object, into a GraphicsPath object, or via the TextRenderer.

Fonts

A font is an instance of the System.Drawing.Font class, which for each font includes a family, a style, and a size. And, as you might expect, a font family is an instance of the FontFamily class, which encapsulates a group of typefaces that differ only in style. A typeface is a named collection of drawing strokes ...

Get Windows Forms 2.0 Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.