Instance Method

textContainerForGlyphAtIndex:effectiveRange:

Returns the container in which the given glyph is laid out and (optionally) by reference the whole range of glyphs that are in that container.

Declaration

- (NSTextContainer *)textContainerForGlyphAtIndex:(NSUInteger)glyphIndex effectiveRange:(NSRangePointer)effectiveGlyphRange;

Parameters

glyphIndex

Index of a glyph in the returned container.

effectiveGlyphRange

If not NULL, on output, points to the whole range of glyphs that are in the returned container.

Return Value

The text container in which the glyph at glyphIndex is laid out.

Discussion

This method causes glyph generation and layout for the line fragment containing the specified glyph, or if noncontiguous layout is not enabled, up to and including that line fragment. If noncontiguous layout is not enabled and effectiveGlyphRange is not NULL, this method additionally causes glyph generation and layout for the entire text container containing the specified glyph.

Overriding this method is not recommended. Any changes to the returned glyph range should be done at the typesetter level.

See Also

Managing the Text Containers

textContainers

The receiver’s text containers.

- addTextContainer:

Appends the given text container to the series of text containers where the receiver arranges text.

- insertTextContainer:atIndex:

Inserts the given text container into the series of text containers at the given index.

- removeTextContainerAtIndex:

Removes the text container at the given index and invalidates the layout as needed.

- setTextContainer:forGlyphRange:

Sets text container where the glyphs in the given range are laid out.

- textContainerChangedGeometry:

Invalidates the layout information, and possibly glyphs, for the given text container and all subsequent NSTextContainer objects.

- textContainerChangedTextView:

Updates information needed to manage NSTextView objects in the given text container.

- textContainerForGlyphAtIndex:effectiveRange:withoutAdditionalLayout:

Returns the container in which the given glyph is laid out and (optionally) by reference the whole range of glyphs that are in that container.

- usedRectForTextContainer:

Returns the bounding rectangle for the glyphs laid out in the given text container.