---
title: "glyphRange(forBoundingRectWithoutAdditionalLayout:in:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nslayoutmanager/glyphrange(forboundingrectwithoutadditionallayout:in:)"
---

# glyphRange(forBoundingRectWithoutAdditionalLayout:in:)

Returns the smallest contiguous range for glyphs lying wholly or partially within the specified rectangle of the text container.

## Declaration

```swift
func glyphRange(forBoundingRectWithoutAdditionalLayout bounds: CGRect, in container: NSTextContainer) -> NSRange
```

## Parameters

- `bounds`: The bounding rectangle for which to return glyphs.
- `container`: The text container in which the glyphs are laid out.

## Return Value

Return Value The range of glyphs that would need to be displayed in order to draw all glyphs that fall (even partially) within the given bounding rectangle. The range returned can include glyphs that don’t fall inside or intersect bounds, although the first and last glyphs in the range always do. At most this method returns the glyph range for the whole container.

## Discussion

Discussion Unlike glyphRange(forBoundingRect:in:), this variant of the method doesn’t perform glyph generation or layout. Its results, though faster, can be incorrect. This method is primarily for use by NSTextView; you should rarely need to use it yourself. Bounding rectangles are always in container coordinates.

## See Also

### Performing advanced layout queries

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