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

# fractionOfDistanceThroughGlyph(for:)

Returns character index for a point inside the line fragment coordinate system.

```
func fractionOfDistanceThroughGlyph(for point: CGPoint) -> CGFloat
```

## Parameters

`point`

A <doc://com.apple.documentation/documentation/CoreFoundation/CGPoint> that represents the point inside the line fragment.

## Return Value

The fraction of distance from the upstream edge.

---

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)