CTFontDescriptor

A font descriptor.

Overview

A font descriptor is a dictionary of attributes (such as name, point size, and variation) that can completely specify a font.

A font descriptor can be an incomplete specification, in which case the system chooses the most appropriate font to match the given attributes.

Topics

Creating Font Descriptors

CTFontDescriptorCreateWithNameAndSize

Creates a new font descriptor with the provided PostScript name and size.

CTFontDescriptorCreateWithAttributes

Creates a new font descriptor reference from a dictionary of attributes.

CTFontDescriptorCreateCopyWithAttributes

Creates a copy of the original font descriptor with new attributes.

CTFontDescriptorCreateCopyWithVariation

Creates a copy of the original font descriptor with a new variation instance.

CTFontDescriptorCreateCopyWithFeature

Copies a font descriptor with new feature settings.

CTFontDescriptorCreateCopyWithFamily

Creates a copy of the font descriptor in the specified family based on the traits of the original.

CTFontDescriptorCreateCopyWithSymbolicTraits

Creates a copy of the font descriptor with the specified symbolic traits as the original.

CTFontDescriptorCreateMatchingFontDescriptors

Returns an array of normalized font descriptors matching the provided descriptor.

CTFontDescriptorCreateMatchingFontDescriptor

Returns the single preferred matching font descriptor based on the original descriptor and system precedence.

Getting Attributes

CTFontDescriptorCopyAttributes

Returns the attributes dictionary of the font descriptor.

CTFontDescriptorCopyAttribute

Returns the value associated with an arbitrary attribute.

CTFontDescriptorCopyLocalizedAttribute

Returns a localized value for the requested attribute, if available.

Getting the Font Descriptor Type

CTFontDescriptorGetTypeID

Returns the type identifier for Core Text font descriptor references.

Data Types

CTFontDescriptorRef

A reference to a CTFontDescriptor object.

Accessing Font Attributes

Font Attributes

The keys for accessing font attributes from a font descriptor.

CTFontOrientation

The intended rendering orientation of the font for obtaining glyph metrics.

CTFontFormat

The recognized format of the font.

CTFontPriority

The priority of font descriptors when resolving duplicates and sorting match results.

Accessing Font Traits

Font Traits

The keys for accessing font traits from a font descriptor.

Font Class Mask Shift Constants

These constants represent the font class mask shift.

CTFontSymbolicTraits

The symbolic representation of stylistic font attributes.

CTFontStylisticClass

The stylistic class values of the font.

See Also

Opaque Types

CTFont

A font object.

CTFramesetter

Generate text frames.

CTGlyphInfo

Override a font's specified mapping from Unicode to the glyph ID.

CTLine

A line of text.

CTParagraphStyle

Paragraph or ruler attributes in an attributed string.

CTTextTab

A tab in a paragraph style, storing an alignment type and location.

CTTypesetter

A typesetter which performs line layout.