CTTypesetter

A typesetter which performs line layout.

Overview

Line layout includes word wrapping, hyphenation, and line breaking in either vertical or horizontal rectangles. A typesetter object takes as input an attributed string and produces a line of typeset glyphs (composed into glyph runs) in a CTLine object. The typesetter performs character-to-glyph encoding, glyph ordering, and positional operations, such as kerning, tracking, and baseline adjustments. If multiline layout is needed, it is performed by a CTFramesetter object, which calls into the typesetter to generate the typeset lines to fill the frame.

A CTFramesetter encapsulates a typesetter and provides a reference to it as a convenience, but a caller may also choose to create a freestanding typesetter.

Topics

Creating a Typesetter

CTTypesetterCreateWithAttributedString

Creates an immutable typesetter object using an attributed string.

CTTypesetterCreateWithAttributedStringAndOptions

Creates an immutable typesetter object using an attributed string and a dictionary of options.

Creating Lines

CTTypesetterCreateLine

Creates an immutable line from the typesetter.

CTTypesetterCreateLineWithOffset

Creates an immutable line from the typesetter at a specified line offset.

Breaking Lines

CTTypesetterSuggestLineBreak

Suggests a contextual line breakpoint based on the width provided.

CTTypesetterSuggestLineBreakWithOffset

Suggests a contextual line breakpoint based on the width provided and the specified offset.

CTTypesetterSuggestClusterBreak

Suggests a cluster line breakpoint based on the width provided.

CTTypesetterSuggestClusterBreakWithOffset

Suggests a cluster line breakpoint based on the specified width and line offset.

Getting the Type Identifier

CTTypesetterGetTypeID

Returns the Core Foundation type identifier of the typesetter object.

Data Types

CTTypesetterRef

A reference to a typesetter object.

Constants

Typesetter Options

These constants control aspects of the typesetter’s bidirectional text processing.

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.