<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextLineFragment/locationForCharacter(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTextLineFragment(im)locationForCharacterAtIndex:"
  },
  "title" : "locationForCharacter(at:)"
}
-->

# locationForCharacter(at:)

Returns the location of the character at the specified index.

```
func locationForCharacter(at index: Int) -> CGPoint
```

## Parameters

`index`

An integer that represents the position in the text.

## Return Value

A <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint> that’s on the upstream edge of the glyph. It’s in the coordinate system relative to the line fragment origin.

---

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)