LayoutManager
class LayoutManager: NSLayoutManager, NSLayoutManagerDelegate
The layout manager for the editor
-
The current font
Declaration
Swift
var font: NSFont
-
The line height of the current font
Declaration
Swift
var fontLineHeight: CGFloat
-
The line height
Declaration
Swift
var lineHeight: CGFloat
-
The nudge of the base line
Declaration
Swift
var baselineNudge: CGFloat
-
Takes care only of the last empty newline in the text backing store, or totally empty text views.
Declaration
Swift
override func setExtraLineFragmentRect( _ fragmentRect: NSRect, usedRect: NSRect, textContainer container: NSTextContainer )
-
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