---
title: "fractionOfDistanceThroughGlyph(for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextlinefragment/fractionofdistancethroughglyph(for:)"
---

# fractionOfDistanceThroughGlyph(for:)

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

## Declaration

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

Return Value The fraction of distance from the upstream edge.

## See Also

### Finding specific text

- [characterIndex(for:)](appkit/nstextlinefragment/characterindex(for:).md)
- [locationForCharacter(at:)](appkit/nstextlinefragment/locationforcharacter(at:).md)
