---
title: "glyphRange(for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nslayoutmanager/glyphrange(for:)"
---

# glyphRange(for:)

Returns the range of glyphs lying within the specified text container.

## Declaration

```swift
func glyphRange(for container: NSTextContainer) -> NSRange
```

## Discussion

Discussion This is a less efficient method than the similar textContainer(forGlyphAt:effectiveRange:). Performs glyph generation and layout if needed.

## See Also

### Performing advanced layout queries

- [boundingRect(forGlyphRange:in:)](appkit/nslayoutmanager/boundingrect(forglyphrange:in:).md)
- [characterIndex(for:in:fractionOfDistanceBetweenInsertionPoints:)](appkit/nslayoutmanager/characterindex(for:in:fractionofdistancebetweeninsertionpoints:).md)
- [characterRange(forGlyphRange:actualGlyphRange:)](appkit/nslayoutmanager/characterrange(forglyphrange:actualglyphrange:).md)
- [enumerateEnclosingRects(forGlyphRange:withinSelectedGlyphRange:in:using:)](appkit/nslayoutmanager/enumerateenclosingrects(forglyphrange:withinselectedglyphrange:in:using:).md)
- [enumerateLineFragments(forGlyphRange:using:)](appkit/nslayoutmanager/enumeratelinefragments(forglyphrange:using:).md)
- [fractionOfDistanceThroughGlyph(for:in:)](appkit/nslayoutmanager/fractionofdistancethroughglyph(for:in:).md)
- [getLineFragmentInsertionPoints(forCharacterAt:alternatePositions:inDisplayOrder:positions:characterIndexes:)](appkit/nslayoutmanager/getlinefragmentinsertionpoints(forcharacterat:alternatepositions:indisplayorder:positions:characterindexes:).md)
- [glyphIndex(for:in:)](appkit/nslayoutmanager/glyphindex(for:in:).md)
- [glyphIndex(for:in:fractionOfDistanceThroughGlyph:)](appkit/nslayoutmanager/glyphindex(for:in:fractionofdistancethroughglyph:).md)
- [glyphRange(forBoundingRect:in:)](appkit/nslayoutmanager/glyphrange(forboundingrect:in:).md)
- [glyphRange(forBoundingRectWithoutAdditionalLayout:in:)](appkit/nslayoutmanager/glyphrange(forboundingrectwithoutadditionallayout:in:).md)
- [glyphRange(forCharacterRange:actualCharacterRange:)](appkit/nslayoutmanager/glyphrange(forcharacterrange:actualcharacterrange:).md)
- [range(ofNominallySpacedGlyphsContaining:)](appkit/nslayoutmanager/range(ofnominallyspacedglyphscontaining:).md)
