---
title: "CTRunGetPositionsPtr(_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctrungetpositionsptr(_:)"
---

# CTRunGetPositionsPtr(_:)

Returns a direct pointer for the glyph position array stored in the run.

## Declaration

```swift
func CTRunGetPositionsPtr(_ run: CTRun) -> UnsafePointer<CGPoint>?
```

## Parameters

- `run`: The run from which to access glyph positions.

## Return Value

Return Value A valid pointer to an array of CGPoint structures, or NULL.

## Discussion

Discussion The glyph positions in a run are relative to the origin of the line containing the run. The position array will have a length equal to the value returned by CTRunGetGlyphCount(_:). The caller should be prepared for this function to return NULL even if there are glyphs in the stream. If this function returns NULL, the caller must allocate its own buffer and call CTRunGetPositions(_:_:_:) to fetch the glyph positions.

## 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)
- [CTRunGetPositions(_:_:_:)](coretext/ctrungetpositions(_:_:_:).md)
- [CTRunGetAdvancesPtr(_:)](coretext/ctrungetadvancesptr(_:).md)
- [CTRunGetAdvances(_:_:_:)](coretext/ctrungetadvances(_:_:_:).md)
- [CTRunGetStringIndicesPtr(_:)](coretext/ctrungetstringindicesptr(_:).md)
- [CTRunGetStringIndices(_:_:_:)](coretext/ctrungetstringindices(_:_:_:).md)
- [CTRunGetStringRange(_:)](coretext/ctrungetstringrange(_:).md)
