Instance Method

layoutRect(for:glyphRange:)

Returns the layout rectangle within which the given text block containing the given glyph range is to be laid out.

Declaration

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

Return Value

The layout 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

func setLayoutRect(NSRect, for: NSTextBlock, glyphRange: NSRange)

Sets the layout rectangle enclosing the given text block containing the given glyph range.

func setBoundsRect(NSRect, for: NSTextBlock, glyphRange: NSRange)

Sets the bounding rectangle enclosing a given text block containing the given glyph range.

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

Returns the bounding rectangle enclosing the given text block containing the given glyph range.

func layoutRect(for: NSTextBlock, at: Int, effectiveRange: NSRangePointer?) -> NSRect

Returns the layout rectangle within which the given text block containing the glyph at the given index is to be laid out.

func boundsRect(for: NSTextBlock, at: Int, effectiveRange: NSRangePointer?) -> NSRect

Returns the bounding rectangle within which the given text block containing the glyph at the given index is to be laid out.