Contents

textLayoutManager(_:textLayoutFragmentFor:in:)

Returns a text layout fragment for the specified location in the text element.

Declaration

optional func textLayoutManager(_ textLayoutManager: NSTextLayoutManager, textLayoutFragmentFor location: any NSTextLocation, in textElement: NSTextElement) -> NSTextLayoutFragment

Parameters

  • textLayoutManager:

    The text layout manager sending the message.

  • location:

    The document location.

  • textElement:

    The text element containing the location.

Return Value

A layout fragment for the location, or nil to use the default.

Discussion

The delegate can provide an NSTextLayoutFragment specialized for an NSTextElement subclass targeted for the rendering surface.

The method the framework calls to give the delegate an opportunity to return a custom text layout fragment.

Discussion

Use this to provide an NSTextLayoutFragment specialized for an NSTextElement subclass targeted for the rendering surface.

See Also

Responding to layout changes