textContainer(forGlyphAt:effectiveRange:withoutAdditionalLayout:)
Returns the text container that manages the layout for the specified glyph.
Declaration
func textContainer(forGlyphAt glyphIndex: Int, effectiveRange effectiveGlyphRange: NSRangePointer?, withoutAdditionalLayout flag: Bool) -> NSTextContainer?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. - flag:
If True, 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 False, both are performed as needed.
Return Value
The text container in which the glyph at glyphIndex is laid out.
Discussion
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.