---
title: "CTTypesetterCreateWithAttributedString(_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/cttypesettercreatewithattributedstring(_:)"
---

# CTTypesetterCreateWithAttributedString(_:)

Creates an immutable typesetter object using an attributed string.

## Declaration

```swift
func CTTypesetterCreateWithAttributedString(_ string: CFAttributedString) -> CTTypesetter
```

## Parameters

- `string`: The attributed string to typeset. This parameter must be filled in with a valid CFAttributedString object.

## Return Value

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

## Discussion

Discussion The resultant typesetter can be used to create lines, perform line breaking, and do other contextual analysis based on the characters in the string.

## See Also

### Creating a Typesetter

- [CTTypesetterCreateWithAttributedStringAndOptions(_:_:)](coretext/cttypesettercreatewithattributedstringandoptions(_:_:).md)
