<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextAttachmentCellProtocol/cellFrame(for:proposedLineFragment:glyphPosition:characterIndex:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextAttachmentCell(im)cellFrameForTextContainer:proposedLineFragment:glyphPosition:characterIndex:"
  },
  "title" : "cellFrame(for:proposedLineFragment:glyphPosition:characterIndex:)"
}
-->

# cellFrame(for:proposedLineFragment:glyphPosition:characterIndex:)

Returns the frame of the cell to draw at the specified position in a text container.

```
nonisolated func cellFrame(for textContainer: NSTextContainer, proposedLineFragment lineFrag: NSRect, glyphPosition position: NSPoint, characterIndex charIndex: Int) -> NSRect
```

## Parameters

`textContainer`

The text container that contains the glyph.

`lineFrag`

The line fragment that contains the glyph.

`position`

The position of the glyph in the text container.

`charIndex`

The index of the character.

## Discussion

The proposed line fragment is specified by `lineFrag`.

---

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)