---
title: "layoutGlyphs(in:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstypesetter/layoutglyphs(in:startingatglyphindex:maxnumberoflinefragments:nextglyphindex:)"
---

# layoutGlyphs(in:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:)

Lays out glyphs in the specified layout manager starting at a specified glyph.

## Declaration

```swift
func layoutGlyphs(in layoutManager: NSLayoutManager, startingAtGlyphIndex startGlyphIndex: Int, maxNumberOfLineFragments maxNumLines: Int, nextGlyphIndex nextGlyph: UnsafeMutablePointer<Int>)
```

## Parameters

- `layoutManager`: The layout manager in which to lay out glyphs.
- `startGlyphIndex`: The index of the starting glyph.
- `maxNumLines`: The maximum number of lines to generate. Fewer lines may be laid out if the glyph storage runs out of glyphs.
- `nextGlyph`: On return, set to the index of the next glyph that needs to be laid out.

## See Also

### Laying out glyphs

- [boundingBox(forControlGlyphAt:for:proposedLineFragment:glyphPosition:characterIndex:)](appkit/nstypesetter/boundingbox(forcontrolglyphat:for:proposedlinefragment:glyphposition:characterindex:).md)
- [getLineFragmentRect(_:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:)](appkit/nstypesetter/getlinefragmentrect(_:usedrect:forparagraphseparatorglyphrange:atproposedorigin:).md)
- [getLineFragmentRect(_:usedRect:remaining:forStartingGlyphAt:proposedRect:lineSpacing:paragraphSpacingBefore:paragraphSpacingAfter:)](appkit/nstypesetter/getlinefragmentrect(_:usedrect:remaining:forstartingglyphat:proposedrect:linespacing:paragraphspacingbefore:paragraphspacingafter:).md)
- [hyphenCharacter(forGlyphAt:)](appkit/nstypesetter/hyphencharacter(forglyphat:).md)
- [hyphenationFactor(forGlyphAt:)](appkit/nstypesetter/hyphenationfactor(forglyphat:).md)
- [shouldBreakLine(byHyphenatingBeforeCharacterAt:)](appkit/nstypesetter/shouldbreakline(byhyphenatingbeforecharacterat:).md)
- [shouldBreakLine(byWordBeforeCharacterAt:)](appkit/nstypesetter/shouldbreakline(bywordbeforecharacterat:).md)
- [willSetLineFragmentRect(_:forGlyphRange:usedRect:baselineOffset:)](appkit/nstypesetter/willsetlinefragmentrect(_:forglyphrange:usedrect:baselineoffset:).md)
- [setHardInvalidation(_:forGlyphRange:)](appkit/nstypesetter/sethardinvalidation(_:forglyphrange:).md)
