<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTFramesetterSuggestFrameSizeWithConstraints(_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTFramesetterSuggestFrameSizeWithConstraints"
  },
  "title" : "CTFramesetterSuggestFrameSizeWithConstraints(_:_:_:_:_:)"
}
-->

# CTFramesetterSuggestFrameSizeWithConstraints(_:_:_:_:_:)

Determines the frame size needed for a string range.

```
func CTFramesetterSuggestFrameSizeWithConstraints(_ framesetter: CTFramesetter, _ stringRange: CFRange, _ frameAttributes: CFDictionary?, _ constraints: CGSize, _ fitRange: UnsafeMutablePointer<CFRange>?) -> CGSize
```

## Parameters

`framesetter`

The framesetter used for measuring the frame size.

`stringRange`

The string range to which the frame size applies. The string range is a range over the string used to create the framesetter. If the length portion of the range is set to `0`, then the framesetter continues to add lines until it runs out of text or space.

`frameAttributes`

Additional attributes that control the frame filling process, or `NULL` if there are no such attributes.

`constraints`

The width and height to which the frame size is constrained. A value of <doc://com.apple.documentation/documentation/CoreFoundation/CGFLOAT_MAX> for either dimension indicates that it should be treated as unconstrained.

`fitRange`

On return, contains the range of the string that actually fit in the constrained size.

## Return Value

The actual dimensions for the given string range and constraints.

## Discussion

This function can be used to determine how much space is needed to display a string, optionally by constraining the space along either dimension.

---

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)