Protocol

NSLayoutManagerDelegate

A set of optional methods implemented by delegates of NSLayoutManager objects.

Declaration

@protocol NSLayoutManagerDelegate

Topics

Invalidating Glyphs and Layout

- layoutManagerDidInvalidateLayout:

Informs the delegate that the given layout manager has invalidated layout information (not glyph information).

- layoutManager:shouldGenerateGlyphs:properties:characterIndexes:font:forGlyphRange:

Enables customizing the initial glyph generation process.

- layoutManager:shouldUseAction:forControlCharacterAtIndex:

Returns the control character action for the control character at the given character index.

Handling Layout for Text Containers

- layoutManager:didCompleteLayoutForTextContainer:atEnd:

Informs the delegate that the given layout manager has finished laying out text in the given text container.

- layoutManager:textContainer:didChangeGeometryFromSize:

Sent right before the layout manager invalidates layout due to the text container changing geometry.

Handling Line Fragments

- layoutManager:shouldBreakLineByWordBeforeCharacterAtIndex:

Sent while determining the soft line break point.

- layoutManager:lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:

Returns the spacing after the line ending with the given glyph index.

- layoutManager:paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:

Returns the paragraph spacing after the line ending with the given glyph index.

- layoutManager:paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:

Returns the paragraph spacing before the line starting with the given glyph index.

- layoutManager:boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:

Returns the bounding rectangle for the specified control glyph with the specified parameters.

- layoutManager:shouldSetLineFragmentRect:lineFragmentUsedRect:baselineOffset:inTextContainer:forGlyphRange:

Customizes the line fragment geometry before committing it to the layout cache.

Managing Temporary Attribute Support

- layoutManager:shouldUseTemporaryAttributes:forDrawingToScreen:atCharacterIndex:effectiveRange:

Sent when the layout manager is drawing and needs to decide whether or not to use temporary attributes.

Relationships

Inherits From

See Also

Layout

NSLayoutManager

An object that coordinates the layout and display of characters held in an NSTextStorage object.

NSTextLayoutOrientationProvider

A set of methods that define the orientation of text for an object.