CTFontDescriptor

The CTFontDescriptor opaque type represents a font descriptor, that is, a dictionary of attributes (such as name, point size, and variation) that can completely specify a font.

Overview

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.

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.

Font Attributes

Font Attribute Constants

These constants are keys for accessing font attributes from a font descriptor.

CTFontOrientation

Specifies the intended rendering orientation of the font for obtaining glyph metrics. These constants are used as values of kCTFontOrientationAttribute.

CTFontFormat

Specifies the recognized format of the font.

CTFontPriority

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

Font Traits

Font Trait Constants

These constants are keys for accessing font traits from a font descriptor.

Font Class Mask Shift Constants

These constants represent the font class mask shift.

CTFontSymbolicTraits

These constants represent the symbolic representation of stylistic font attributes.

CTFontStylisticClass

These constants represent the stylistic class values of the font.

See Also

Opaque Types

CTFont

The CTFont opaque type represents a Core Text font object. Font objects represent fonts to an application, providing access to characteristics of the font, such as point size, transform matrix, and other attributes. Fonts provide assistance in laying out glyphs relative to one another and are used to establish the current font when drawing in a graphics context.

CTFontCollection

The CTFontCollection opaque type represents a font collection, that is, a group of font descriptors taken together as a single object.

CTFrame

The CTFrame opaque type represents a frame containing multiple lines of text. The frame object is the output resulting from the text-framing process performed by a framesetter object.

CTFramesetter

The CTFramesetter opaque type is used to generate text frames. That is, CTFramesetter is an object factory for CTFrame objects.

CTGlyphInfo

The CTGlyphInfo opaque type enables you to override a font's specified mapping from Unicode to the glyph ID.

CTLine

The CTLine opaque type represents a line of text.

CTParagraphStyle

The CTParagraphStyle opaque type represents paragraph or ruler attributes in an attributed string.

CTRun

The CTRun opaque type represents a glyph run, which is a set of consecutive glyphs sharing the same attributes and direction.

CTRunDelegate

The CTRunDelegate opaque type represents a run delegate, which is assigned to a run (attribute range) to control typographic traits such glyph ascent, glyph descent, and glyph width.

CTTextTab

The CTTextTab opaque type represents a tab in a paragraph style, storing an alignment type and location.

CTTypesetter

The CTTypesetter opaque type represents a typesetter, which performs line layout.