This chapter describes the basic text support provided by Quartz and shows how to use Quartz 2D text in your application. Quartz 2D provides a limited, low-level interface for drawing text encoded in the MacRoman text encoding and for drawing glyphs. (See CGFont Reference.) If basic text support is all your application needs, then read this chapter. If you want to support user input of text, text editing, or you need precise control over text layout or access to font features, you may want to skip this chapter and instead read Getting Started with Text and Fonts and then investigate using one of the following:
Core Text, introduced in Mac OS X v10.5, is an advanced, low-level technology for laying out text and handling fonts that is designed for high performance and ease of use. Its layout engine is up to twice as fast as ATSUI (Apple Type Services Unicode Imaging). Like ATSUI, you can use Core Text to draw Unicode text directly to a graphics context. If possible, you should use Core Text.
ATSUI lays out and draw text. If your application needs to perform a task that’s not supported by Core Text, consider ATSUI. If your application runs in versions of Mac OS X earlier that v10.5, you’ll need to use ATSUI for layout service.
The text facilities provided through the Carbon and Cocoa frameworks.
How Quartz 2D Draws Text
Controlling How Text Looks
Drawing Text
Measuring Text Before Drawing
Copying Font Variations
PostScript Fonts
See Also
Last updated: 2007-12-11