Next Page > Hide TOC

Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

NSFontDescriptor

Inherits from
Implements
Package
com.apple.cocoa.application
Availability
Available in Mac OS X v10.3 and later.
Companion guide

Overview

NSFontDescriptor objects provide a mechanism to describe a font with a dictionary of attributes. This font descriptor can be used later to create or modify an NSFont object.

All attributes in the attributes dictionary are optional.

Tasks

Constructors

Getting Information About a Font Descriptor

Constructors

NSFontDescriptor

Creates an empty NSFontDescriptor.

public NSFontDescriptor()

Availability

Creates an NSFontDescriptor with a dictionary of attributes.

public NSFontDescriptor(NSDictionary attributes)

Discussion

If attributes is null, the font descriptor’s dictionary will be empty.

Availability

Instance Methods

fontAttributes

Returns the receiver’s dictionary of attributes.

public NSDictionary fontAttributes()

Availability

Constants

The following font attributes are defined by NSFontDescriptor:

Attribute Identifier

Value Class

Default Value

FontFamilyAttribute

String

None (optional)

FontNameAttribute

String

None (optional)

FontFaceAttribute

String

None (optional)

FontSizeAttribute

String, as a float

None (optional)

FontVisibleNameAttribute

String

None (optional)

FontColorAttribute

NSData

None (optional)



Next Page > Hide TOC


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


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.