Instance Method

setAttachmentSize(_:forGlyphRange:)

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

Declaration

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

Parameters

attachmentSize

The glyph size to set.

glyphRange

The attachment glyph’s position in the glyph stream.

Discussion

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 where 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 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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software