Instance Method

setDrawsOutsideLineFragment(_:forGlyphAt:)

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

Declaration

func setDrawsOutsideLineFragment(_ flag: Bool, forGlyphAt glyphIndex: Int)

Parameters

flag

If true, sets the given glyph to draw outside its line fragment; if false, the glyph does not draw outside.

glyphIndex

Index of the glyph to set.

Discussion

This can happen when text is set at a fixed line height. For example, if the user specifies a fixed line height of 12 points and sets the font size to 24 points, the glyphs will exceed their layout rectangles. This information is important for determining whether additional lines need to be redrawn as a result of changes to any given line fragment.

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 setExtraLineFragmentRect(CGRect, usedRect: CGRect, textContainer: NSTextContainer)

Sets the bounds and container for the extra line fragment.

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.