Contents

layoutManager(_:boundingBoxForControlGlyphAt:for:proposedLineFragment:glyphPosition:characterIndex:)

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

Declaration

optional func layoutManager(_ layoutManager: NSLayoutManager, boundingBoxForControlGlyphAt glyphIndex: Int, for textContainer: NSTextContainer, proposedLineFragment proposedRect: NSRect, glyphPosition: NSPoint, characterIndex charIndex: Int) -> NSRect

Parameters

  • layoutManager:

    The layout manager doing the layout.

  • glyphIndex:

    The index of the control glyph in question.

  • textContainer:

    The text container to use to calculate the position.

  • proposedRect:

    The proposed line fragment rectangle.

  • glyphPosition:

    The position of the glyph in textContainer.

  • charIndex:

    The character index in textContainer.

Return Value

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

Discussion

Sent for resolving the glyph metrics for NSControlCharacterWhitespaceAction control character.

See Also

Handling line fragments