This chapter provides general guidelines for using ATSUI and provides step-by-step instructions for the basic tasks you can perform with ATSUI. These tasks are described in the following sections:
“Creating Style Objects and Setting Attributes” shows how to use ATSUI functions to create a style object and provides instructions for associating one or more style attributes with an object.
“Creating a Text Layout Object and Setting Attributes” describes how to create a text layout object, set layout attributes to control the text associated with the text layout object, and associate style objects with the text layout.
“Determining Paragraphs in a Unicode Text Block” provides an example of how to find paragraph separators in a block of text.
“Drawing Horizontal Text” shows how to use ATSUI to render horizontal text.
“Drawing Text Using a Quartz Context” details how to use a Quartz drawing context in conjunction with ATSUI.
“Drawing Equations” shows how to use style attributes to draw equations that contain subscripts and superscripts.
“Drawing Vertical Text” describes how to use ATSUI to renter vertical text.
“Breaking Lines” shows how to set soft line breaks programmatically and how to use ATSUIās batch line-breaking function.
“Measuring Text” provides information on the functions to use to obtain text measurements.
“Calculating Line Height” discusses the preferred method for setting line height in Mac OS X version 10.2 and describes what to you if your application runs in an earlier version of the Mac OS.
“Flowing Text Around a Graphic ” shows the preferred way to draw text so that it flows around an image.
“Setting Up a Tab Ruler” provides step-by-step instructions for setting up a tab ruler for a text layout object.
Before you read this chapter, you should be familiar with the concepts discussed in “Typography Concepts” and “ATSUI Style and Text Layout Objects,” “ATSUI Style and Text Layout Objects.”
This chapter provides a number of code samples to illustrate how to use ATSUI. 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/
Last updated: 2007-07-10