Instance Method

setExtraLineFragmentRect(_:usedRect:textContainer:)

Sets the bounds and container for the extra line fragment.

Declaration

iOS, tvOS
func setExtraLineFragmentRect(_ fragmentRect: CGRect, usedRect: CGRect, textContainer container: NSTextContainer)
macOS
func setExtraLineFragmentRect(_ fragmentRect: NSRect, usedRect: NSRect, textContainer container: NSTextContainer)

Parameters

aRect

The rectangle to set.

usedRect

Indicates where the insertion point is drawn.

aTextContainer

The text container where the rectangle is to be laid out.

Discussion

The extra line fragment is used when the text backing ends with a hard line break or when the text backing is totally empty, to define the extra line which needs to be displayed at the end of the text. If the text backing is not empty and does not end with a hard line break, this should be set to NSZeroRect and nil.

Line fragment rectangles and line fragment used rectangles are always in container coordinates.

This method is used by the layout mechanism and should be invoked only during typesetting, in almost all cases only by the typesetter. For example, a custom typesetter might invoke it.

See Also

Setting Layout Information

func setAttachmentSize(CGSize, forGlyphRange: NSRange)

Sets the size at which the given glyph (assumed to be an attachment) is asked to draw in the given glyph range.

func setDrawsOutsideLineFragment(Bool, forGlyphAt: Int)

Specifies whether the given glyph exceeds the bounds of the line fragment where it’s laid out.

func setLineFragmentRect(CGRect, forGlyphRange: NSRange, usedRect: CGRect)

Associates the given line fragment bounds with the given range of glyphs.

func setLocation(CGPoint, forStartOfGlyphRange: NSRange)

Sets the location for the first glyph of the given range.

func setNotShownAttribute(Bool, forGlyphAt: Int)

Sets the glyph at the given index to be one that isn’t shown.