Chapter 9. Text and Fonts

The well-made page is now what it was then ...

Robert Bringhurst, The Elements of Typographic Style

People have been writing for millennia, starting with styli on clay tablets, moving to ink on paper, and now using pixels on monitors and laser printers. Writing on a computer is accomplished with text, the characters that make up the content, and fonts, which provide the visual aspect to the characters, such as typestyle and size.[1]

Text is ubiquitous. All the examples in this book have used text. Every control has a Text property. The contents of this Text property generally must be rendered (some controls do not render their Text property) on the screen or on a piece of paper. Many controls, such as the Label, TextBox, and RichTextBox, exist primarily to display text. Furthermore, many applications draw text directly on the client area of the form.

This chapter shows how text and fonts are handled in .NET applications.

[1] This chapter deals only with western-style text and not with ideograms as used in Chinese and Japanese text.

Get Programming .NET Windows Applications 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.