---
title: "boundsRect(for:at:effectiveRange:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nslayoutmanager/boundsrect(for:at:effectiverange:)"
---

# boundsRect(for:at:effectiveRange:)

Returns the bounding rectangle for the specified text block and glyph.

## Declaration

```swift
func boundsRect(for block: NSTextBlock, at glyphIndex: Int, effectiveRange effectiveGlyphRange: NSRangePointer?) -> NSRect
```

## Parameters

- `block`: The text block whose bounding rectangle is returned.
- `glyphIndex`: Index of the glyph.
- `effectiveGlyphRange`: If not NULL, on output, the range for all glyphs in the text block.

## Return Value

Return Value The bounding rectangle of the text block, or NSZeroRect if no rectangle has been set for the specified block since the last invalidation.

## Discussion

Discussion This method causes glyph generation but not layout. Block layout rectangles and bounds rectangles are always in container coordinates.

## See Also

### Handling layout for text blocks

- [setLayoutRect(_:for:glyphRange:)](appkit/nslayoutmanager/setlayoutrect(_:for:glyphrange:).md)
- [layoutRect(for:glyphRange:)](appkit/nslayoutmanager/layoutrect(for:glyphrange:).md)
- [setBoundsRect(_:for:glyphRange:)](appkit/nslayoutmanager/setboundsrect(_:for:glyphrange:).md)
- [boundsRect(for:glyphRange:)](appkit/nslayoutmanager/boundsrect(for:glyphrange:).md)
- [layoutRect(for:at:effectiveRange:)](appkit/nslayoutmanager/layoutrect(for:at:effectiverange:).md)
