Contents

boundsRect(for:glyphRange:)

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

Declaration

func boundsRect(for block: NSTextBlock, glyphRange: NSRange) -> NSRect

Parameters

  • block:

    The text block whose bounds rectangle is returned.

  • glyphRange:

    The range of glyphs in the text block.

Return Value

The bounding rectangle, or NSZeroRect if no rectangle has been set for the specified block since the last invalidation

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