---
title: "cellFrame(for:proposedLineFragment:glyphPosition:characterIndex:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextattachmentcellprotocol/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.

## Declaration

```swift
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

Discussion The proposed line fragment is specified by lineFrag.

## See Also

### Providing the cell metrics

- [cellSize()](appkit/nstextattachmentcellprotocol/cellsize().md)
- [cellBaselineOffset()](appkit/nstextattachmentcellprotocol/cellbaselineoffset().md)
