Skip to Main Content
Cocoa Programming for Mac OS X, Third Edition
book

Cocoa Programming for Mac OS X, Third Edition

by Aaron Hillegass
May 2008
Intermediate to advanced content levelIntermediate to advanced
464 pages
8h 13m
English
Addison-Wesley Professional
Content preview from Cocoa Programming for Mac OS X, Third Edition

Chapter 20. Drawing Text with Attributes

The next step is to get the string to appear in our view. At the end of the chapter, your application will look like Figure 20.1. The character being displayed will change as you type.

Completed Application

Figure 20.1. Completed Application

NSFont

Overall, the class NSFont has basically only two types of methods:

  1. Class methods for getting the font you want

  2. Methods for getting metrics on the font, such as letter height

The following are commonly used methods in NSFont.

+ (NSFont *)fontWithName:(NSString *)fontName size:(float)fontSize

This method returns a font object. fontName is a family-face name, such as HelveticaBoldOblique or Times-Roman. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

COCOA PROGRAMMING FOR MAC OS X SECOND EDITION

COCOA PROGRAMMING FOR MAC OS X SECOND EDITION

Aaron Hillegass

Publisher Resources

ISBN: 9780321562739Purchase book