Instance Method


Sets the size to use when drawing a glyph that represents an attachment.


iOS, Mac Catalyst, tvOS
func setAttachmentSize(_ attachmentSize: CGSize, forGlyphRange glyphRange: NSRange)
func setAttachmentSize(_ attachmentSize: NSSize, forGlyphRange glyphRange: NSRange)



The glyph size to set.


The attachment glyph’s position in the glyph stream.


For a glyph corresponding to an attachment, this method should be called to set the size for the attachment cell to occupy. The glyph's value should be NSControlGlyph.

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 setDrawsOutsideLineFragment(Bool, forGlyphAt: Int)

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

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 line fragment bounds for the specified range of glyphs.

func setLocation(CGPoint, forStartOfGlyphRange: NSRange)

Sets the location for the first glyph in the specified range.

func setNotShownAttribute(Bool, forGlyphAt: Int)

Sets the visibility of the glyph at the specified index.