---
title: "CTRunGetStringIndices(_:_:_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctrungetstringindices(_:_:_:)"
---

# CTRunGetStringIndices(_:_:_:)

Copies a range of string indices into a user-provided buffer.

## Declaration

```swift
func CTRunGetStringIndices(_ run: CTRun, _ range: CFRange, _ buffer: UnsafeMutablePointer<CFIndex>)
```

## Parameters

- `run`: The run from which to copy the string indices.
- `range`: The range of string indices to copy. If the length of the range is set to 0, then the copy operation continues from the range’s start index to the end of the run.
- `buffer`: The buffer to which the string indices are copied. The buffer must be allocated to at least the value specified by the range’s length.

## Discussion

Discussion The indices are the character indices that originally spawned the glyphs that make up the run. They can be used to map the glyphs in the run back to the characters in the backing store.

## See Also

### Getting Glyph Run Data

- [CTRunGetGlyphCount(_:)](coretext/ctrungetglyphcount(_:).md)
- [CTRunGetAttributes(_:)](coretext/ctrungetattributes(_:).md)
- [CTRunGetStatus(_:)](coretext/ctrungetstatus(_:).md)
- [CTRunGetGlyphsPtr(_:)](coretext/ctrungetglyphsptr(_:).md)
- [CTRunGetGlyphs(_:_:_:)](coretext/ctrungetglyphs(_:_:_:).md)
- [CTRunGetPositionsPtr(_:)](coretext/ctrungetpositionsptr(_:).md)
- [CTRunGetPositions(_:_:_:)](coretext/ctrungetpositions(_:_:_:).md)
- [CTRunGetAdvancesPtr(_:)](coretext/ctrungetadvancesptr(_:).md)
- [CTRunGetAdvances(_:_:_:)](coretext/ctrungetadvances(_:_:_:).md)
- [CTRunGetStringIndicesPtr(_:)](coretext/ctrungetstringindicesptr(_:).md)
- [CTRunGetStringRange(_:)](coretext/ctrungetstringrange(_:).md)
