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

# setBoundsRect(_:for:glyphRange:)

Sets the bounding rectangle that encloses the specified text block and glyph range.

## Declaration

```swift
func setBoundsRect(_ rect: NSRect, for block: NSTextBlock, glyphRange: NSRange)
```

## Parameters

- `rect`: The bounding rectangle to set.
- `block`: The text block whose bounding rectangle is set.
- `glyphRange`: The range of glyphs in the text block.

## 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)
- [boundsRect(for:glyphRange:)](appkit/nslayoutmanager/boundsrect(for:glyphrange:).md)
- [layoutRect(for:at:effectiveRange:)](appkit/nslayoutmanager/layoutrect(for:at:effectiverange:).md)
- [boundsRect(for:at:effectiveRange:)](appkit/nslayoutmanager/boundsrect(for:at:effectiverange:).md)
