< Previous PageNext Page > Hide TOC

Creating a Font Object

You don’t create font objects using the alloc and init methods (or with constructors in Java), instead, you use either fontWithName:matrix: or fontWithName:size: to look up an available font and alter its size or matrix to your needs. These methods check for an existing font object with the specified characteristics, returning it if there is one. Otherwise, they look up the font data requested and create the appropriate object.

NSFont also defines a number of methods for specifying standard system fonts, such as systemFontOfSize:, userFontOfSize:, and messageFontOfSize:. To request the default size for these standard fonts, pass 0 or a negative number as the font size. The standard system font methods are listed in “Querying Aqua Font Variations.”



< Previous PageNext Page > Hide TOC


© 1997, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-02-08)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.