---
title: "fractionOfDistanceThroughGlyph(for:in:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nslayoutmanager/fractionofdistancethroughglyph(for:in:)"
---

# fractionOfDistanceThroughGlyph(for:in:)

Returns the fraction of the distance between the glyph at the specified point and the next glyph.

## Declaration

```swift
func fractionOfDistanceThroughGlyph(for point: CGPoint, in container: NSTextContainer) -> CGFloat
```

## Discussion

Discussion This method is a primitive for glyphIndex(for:in:fractionOfDistanceThroughGlyph:). You should always call the main method, not the primitives. Overriding should be done for the primitive methods. Existing subclasses that do not do this overriding will not have their implementations available to Java developers.

## See Also

### Performing advanced layout queries

- [boundingRect(forGlyphRange:in:)](uikit/nslayoutmanager/boundingrect(forglyphrange:in:).md)
- [characterIndex(for:in:fractionOfDistanceBetweenInsertionPoints:)](uikit/nslayoutmanager/characterindex(for:in:fractionofdistancebetweeninsertionpoints:).md)
- [characterRange(forGlyphRange:actualGlyphRange:)](uikit/nslayoutmanager/characterrange(forglyphrange:actualglyphrange:).md)
- [enumerateEnclosingRects(forGlyphRange:withinSelectedGlyphRange:in:using:)](uikit/nslayoutmanager/enumerateenclosingrects(forglyphrange:withinselectedglyphrange:in:using:).md)
- [enumerateLineFragments(forGlyphRange:using:)](uikit/nslayoutmanager/enumeratelinefragments(forglyphrange:using:).md)
- [getLineFragmentInsertionPoints(forCharacterAt:alternatePositions:inDisplayOrder:positions:characterIndexes:)](uikit/nslayoutmanager/getlinefragmentinsertionpoints(forcharacterat:alternatepositions:indisplayorder:positions:characterindexes:).md)
- [glyphIndex(for:in:)](uikit/nslayoutmanager/glyphindex(for:in:).md)
- [glyphIndex(for:in:fractionOfDistanceThroughGlyph:)](uikit/nslayoutmanager/glyphindex(for:in:fractionofdistancethroughglyph:).md)
- [glyphRange(forBoundingRect:in:)](uikit/nslayoutmanager/glyphrange(forboundingrect:in:).md)
- [glyphRange(forBoundingRectWithoutAdditionalLayout:in:)](uikit/nslayoutmanager/glyphrange(forboundingrectwithoutadditionallayout:in:).md)
- [glyphRange(for:)](uikit/nslayoutmanager/glyphrange(for:).md)
- [glyphRange(forCharacterRange:actualCharacterRange:)](uikit/nslayoutmanager/glyphrange(forcharacterrange:actualcharacterrange:).md)
- [range(ofNominallySpacedGlyphsContaining:)](uikit/nslayoutmanager/range(ofnominallyspacedglyphscontaining:).md)
