---
title: "attachmentSize(forGlyphAt:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nslayoutmanager/attachmentsize(forglyphat:)"
---

# attachmentSize(forGlyphAt:)

Returns the size of the attachment glyph at the specified index.

## Declaration

```swift
func attachmentSize(forGlyphAt glyphIndex: Int) -> NSSize
```

## Parameters

- `glyphIndex`: The index of the attachment glyph.

## Return Value

Return Value The layout manager calls this method for glyphs representing attachments, and returns the size that the attachment cell occupies. Returns {-1.0, -1.0} if there is no attachment laid for the specified glyph.

## See Also

### Getting layout information

- [drawsOutsideLineFragment(forGlyphAt:)](appkit/nslayoutmanager/drawsoutsidelinefragment(forglyphat:).md)
- [extraLineFragmentRect](appkit/nslayoutmanager/extralinefragmentrect.md)
- [extraLineFragmentTextContainer](appkit/nslayoutmanager/extralinefragmenttextcontainer.md)
- [extraLineFragmentUsedRect](appkit/nslayoutmanager/extralinefragmentusedrect.md)
- [firstUnlaidCharacterIndex()](appkit/nslayoutmanager/firstunlaidcharacterindex().md)
- [firstUnlaidGlyphIndex()](appkit/nslayoutmanager/firstunlaidglyphindex().md)
- [getFirstUnlaidCharacterIndex(_:glyphIndex:)](appkit/nslayoutmanager/getfirstunlaidcharacterindex(_:glyphindex:).md)
- [lineFragmentRect(forGlyphAt:effectiveRange:)](appkit/nslayoutmanager/linefragmentrect(forglyphat:effectiverange:).md)
- [lineFragmentRect(forGlyphAt:effectiveRange:withoutAdditionalLayout:)](appkit/nslayoutmanager/linefragmentrect(forglyphat:effectiverange:withoutadditionallayout:).md)
- [lineFragmentUsedRect(forGlyphAt:effectiveRange:)](appkit/nslayoutmanager/linefragmentusedrect(forglyphat:effectiverange:).md)
- [lineFragmentUsedRect(forGlyphAt:effectiveRange:withoutAdditionalLayout:)](appkit/nslayoutmanager/linefragmentusedrect(forglyphat:effectiverange:withoutadditionallayout:).md)
- [location(forGlyphAt:)](appkit/nslayoutmanager/location(forglyphat:).md)
- [notShownAttribute(forGlyphAt:)](appkit/nslayoutmanager/notshownattribute(forglyphat:).md)
- [truncatedGlyphRange(inLineFragmentForGlyphAt:)](appkit/nslayoutmanager/truncatedglyphrange(inlinefragmentforglyphat:).md)
