LayoutManager

class LayoutManager: NSLayoutManager, NSLayoutManagerDelegate

The layout manager for the editor

Layout Manager Delegate

  • Customise the line fragment geometry before committing to the layout cache

    Declaration

    Swift

    func layoutManager(
        _ layoutManager: NSLayoutManager,
        shouldSetLineFragmentRect lineFragmentRect: UnsafeMutablePointer<NSRect>,
        lineFragmentUsedRect: UnsafeMutablePointer<NSRect>,
        baselineOffset: UnsafeMutablePointer<CGFloat>,
        in textContainer: NSTextContainer,
        forGlyphRange glyphRange: NSRange
    ) -> Bool

    Parameters

    layoutManager

    The current layout manager

    lineFragmentRect

    The rect of the line fragment

    lineFragmentUsedRect

    The used rect of the line fragment

    baselineOffset

    The offset from the base line

    textContainer

    The current text container

    glyphRange

    The current glyp range

    Return Value

    True