Instance Method

layoutRectForTextBlock:atIndex:effectiveRange:

Returns the rectangle in which to lay out the specified text block and glyph.

Declaration

- (NSRect)layoutRectForTextBlock:(NSTextBlock *)block atIndex:(NSUInteger)glyphIndex effectiveRange:(NSRangePointer)effectiveGlyphRange;

Parameters

block

The text block whose layout 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

The layout rectangle of the text block, 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

- setLayoutRect:forTextBlock:glyphRange:

Sets the layout rectangle enclosing the specified text block and glyph range.

- layoutRectForTextBlock:glyphRange:

Returns the rectangle in which to lay out the specified text block and glyph range.

- setBoundsRect:forTextBlock:glyphRange:

Sets the bounding rectangle enclosing the specified text block and glyph range.

- boundsRectForTextBlock:glyphRange:

Returns the bounding rectangle enclosing the specified text block and glyph range.

- boundsRectForTextBlock:atIndex:effectiveRange:

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