---
title: "layoutCharacters(in:for:maximumNumberOfLineFragments:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstypesetter/layoutcharacters(in:for:maximumnumberoflinefragments:)"
---

# layoutCharacters(in:for:maximumNumberOfLineFragments:)

Lays out characters in the given character range for the specified layout manager.

## Declaration

```swift
func layoutCharacters(in characterRange: NSRange, for layoutManager: NSLayoutManager, maximumNumberOfLineFragments maxNumLines: Int) -> NSRange
```

## Parameters

- `characterRange`: The range of the characters to lay out.
- `layoutManager`: The layout manager that does the drawing.
- `maxNumLines`: The maximum number of line fragments to lay out. Specify NSUIntegerMax for unlimited number of line fragments.

## Return Value

Return Value The method returns the actual character range that the receiving NSTypesetter processed.

## Discussion

Discussion The layout process can be interrupted when the number of line fragments exceeds maxNumLines.
