<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTTypesetter",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@T@CTTypesetterRef"
  },
  "title" : "CTTypesetter"
}
-->

# CTTypesetter

A typesetter which performs line layout.

```
class CTTypesetter
```

## 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`](/documentation/CoreText/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`](/documentation/CoreText/CTFramesetter) object, which calls into the typesetter to generate the typeset lines to fill the frame.

A [`CTFramesetter`](/documentation/CoreText/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(_:)`](/documentation/CoreText/CTTypesetterCreateWithAttributedString(_:))

Creates an immutable typesetter object using an attributed string.

[`CTTypesetterCreateWithAttributedStringAndOptions(_:_:)`](/documentation/CoreText/CTTypesetterCreateWithAttributedStringAndOptions(_:_:))

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

### Creating Lines

[`CTTypesetterCreateLine(_:_:)`](/documentation/CoreText/CTTypesetterCreateLine(_:_:))

Creates an immutable line from the typesetter.

[`CTTypesetterCreateLineWithOffset(_:_:_:)`](/documentation/CoreText/CTTypesetterCreateLineWithOffset(_:_:_:))

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

### Breaking Lines

[`CTTypesetterSuggestLineBreak(_:_:_:)`](/documentation/CoreText/CTTypesetterSuggestLineBreak(_:_:_:))

Suggests a contextual line breakpoint based on the width provided.

[`CTTypesetterSuggestLineBreakWithOffset(_:_:_:_:)`](/documentation/CoreText/CTTypesetterSuggestLineBreakWithOffset(_:_:_:_:))

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

[`CTTypesetterSuggestClusterBreak(_:_:_:)`](/documentation/CoreText/CTTypesetterSuggestClusterBreak(_:_:_:))

Suggests a cluster line breakpoint based on the width provided.

[`CTTypesetterSuggestClusterBreakWithOffset(_:_:_:_:)`](/documentation/CoreText/CTTypesetterSuggestClusterBreakWithOffset(_:_:_:_:))

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

### Getting the Type Identifier

[`CTTypesetterGetTypeID()`](/documentation/CoreText/CTTypesetterGetTypeID())

Returns the Core Foundation type identifier of the typesetter object.

### Constants

[Typesetter Options](/documentation/CoreText/typesetter-options)

Control aspects of the typesetter’s text processing.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)