Instance Method


Returns the text container that manages the layout for the specified glyph.


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



Index of a glyph in the returned container.


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


If YES, glyph generation and layout are not performed, so this option should not be used unless layout is known to be complete for the range in question, or unless noncontiguous layout is enabled; if NO, both are performed as needed.

Return Value

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


This method is primarily for use from within NSTypesetter, after layout is complete for the range in question, but before the layout manager's call to NSTypesetter has returned. In that case glyph and layout holes have not yet been recalculated, so the layout manager does not yet know that layout is complete for that range, and this variant must be used.

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


The current text containers of the layout manager.

- addTextContainer:

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

- insertTextContainer:atIndex:

Inserts a text container at the specified index in the list of text containers.

- removeTextContainerAtIndex:

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

- setTextContainer:forGlyphRange:

Associates a text container with the specified range of glyphs.

- textContainerChangedGeometry:

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

- textContainerChangedTextView:

Updates the information needed to manage text view objects associated with the specified text container.

- textContainerForGlyphAtIndex:effectiveRange:

Returns the text container that manages the layout for the specified glyph, causing layout to happen as needed.

- usedRectForTextContainer:

Returns the bounding rectangle for the glyphs in the specified text container.