<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTRunGetAdvancesPtr(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTRunGetAdvancesPtr"
  },
  "title" : "CTRunGetAdvancesPtr(_:)"
}
-->

# CTRunGetAdvancesPtr(_:)

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

```
func CTRunGetAdvancesPtr(_ run: CTRun) -> UnsafePointer<CGSize>?
```

## Parameters

`run`

The run whose advances you wish to access.

## Return Value

A valid pointer to an array of `CGSize` structures representing the glyph advance array or `NULL`.

## Discussion

The advance array will have a length equal to the value returned by [`CTRunGetGlyphCount(_:)`](/documentation/CoreText/CTRunGetGlyphCount(_:)). The caller should be prepared for this function to return `NULL` even if there are glyphs in the stream. Should this function return `NULL`, the caller needs allocate its own buffer and call [`CTRunGetAdvances(_:_:_:)`](/documentation/CoreText/CTRunGetAdvances(_:_:_:)) to fetch the advances. Note that advances alone are not sufficient for correctly positioning glyphs in a line, as a run may have a non-identity matrix or the initial glyph in a line may have a non-zero origin; callers should consider using positions instead.

---

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)