ATSUI provides a set of functions that enable you to access information about glyphs during the layout process. These functions are called direct-access functions because they allow you to manipulate glyph data directly. You can use direct-access functions to control many aspects of ATSUI’s internal layout process and, as a result, control how ATSUI draws text for your application. For example, you can override one or more steps of the ATSUI layout process, exercise fine control over layout metrics, specify glyph replacements, and perform post-layout processing.
Note: Direct-access functions should be used only if you provide your own text layout engine in your application. Most developers do not need to use direct-access functions, because ATSUI provides line and layout attributes that support the requirements of most applications.
You can call ATSUI direct-access functions along with functions you’ve provided in your text layout engine. Mixing your functions with ATSUI’s reduces the processing ATSUI does by default and enables you to perform your own layout adjustments.
This chapter shows you how to use ATSUI’s direct-access functions in the following sections:
“Overriding ATSUI Layout Operations ” shows how to write and install callbacks that obtain and modify glyph positioning information.
“Retrieving and Drawing Glyph Outlines” provides information on obtaining the curves that make up a glyph shape and using your own functions to draw them.
Before you read this chapter you should be familiar with the text measurement terms discussed in Chapter 2, “Typography Concepts” and know how to perform the tasks discussed in Chapter 4, “Basic Tasks: Working With Objects and Drawing Text.”
This chapter provides a number of code samples to illustrate how to use direct-access functions. You can obtain the sample applications from which this code is taken, as well as additional code samples, from the developer sample code website:
http://developer.apple.com/samplecode/
Overriding ATSUI Layout Operations
Retrieving and Drawing Glyph Outlines
Last updated: 2007-07-10