---
title: "CTTypesetterCreateWithAttributedStringAndOptions(_:_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/cttypesettercreatewithattributedstringandoptions(_:_:)"
---

# CTTypesetterCreateWithAttributedStringAndOptions(_:_:)

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

## Declaration

```swift
func CTTypesetterCreateWithAttributedStringAndOptions(_ string: CFAttributedString, _ options: CFDictionary?) -> CTTypesetter?
```

## Parameters

- `string`: The attributed string to typeset. This parameter must be a valid CFAttributedString object.
- `options`: A dictionary of typesetter options, or NULL if there are none.

## Return Value

Return Value A reference to a typesetter object if the call is successful; otherwise, NULL.

## Discussion

Discussion Use the typesetter to create lines, perform line breaking, and do other contextual analysis according to the characters in the string. important: By default, this function returns NULL if the string requires unreasonable effort to typeset. To create a typesetter that always typesets the text, regardless of the amount of effort, set the kCTTypesetterOptionAllowUnboundedLayout option to kCFBooleanTrue.

## See Also

### Creating a Typesetter

- [CTTypesetterCreateWithAttributedString(_:)](coretext/cttypesettercreatewithattributedstring(_:).md)
