<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTypesetter/setAttachmentSize(_:forGlyphRange:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTypesetter(im)setAttachmentSize:forGlyphRange:"
  },
  "title" : "setAttachmentSize(_:forGlyphRange:)"
}
-->

# setAttachmentSize(_:forGlyphRange:)

Sets the size the specified glyphs (assumed to be attachments) will be asked to draw themselves at.

```
func setAttachmentSize(_ attachmentSize: NSSize, forGlyphRange glyphRange: NSRange)
```

## Parameters

`attachmentSize`

The size the glyphs in `glyphRange` (assumed to be attachments) will be asked to draw themselves at.

`glyphRange`

The range of glyphs the attachment size applies to.

## Discussion

A subclass can override this method to interact with custom glyph storage.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)