Drawing Text

Drawing text is an extremely complex process. Because of this, the Application Kit provides the NSText object just for this purpose. Because of the complexity of this object, a whole chapter of this book (Chapter 11, “Text Views”) has been devoted to the NSText and related objects. Sometimes the NSText object is overkill for the type of text rendering that needs to be accomplished. At other times, it doesn’t provide some of the special, in-depth manipulation options that would be useful in a heavy-duty graphically oriented application. In these cases, there are some other alternatives available that might make more sense.

The Application Kit adds drawing methods to the NSString and NSAttributedString classes. These methods are useful ...

Get Cocoa® 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.