<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTRunDelegateCallbacks",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@SA@CTRunDelegateCallbacks"
  },
  "title" : "CTRunDelegateCallbacks"
}
-->

# CTRunDelegateCallbacks

A structure holding pointers to callbacks implemented by the run delegate.

```
struct CTRunDelegateCallbacks
```

## Overview

You pass in a pointer to this structure when you create a CTRunDelegate object with the [`CTRunDelegateCreate(_:_:)`](/documentation/CoreText/CTRunDelegateCreate(_:_:)) function. The callbacks defined in this structure are provided by the owner of a run delegate and are used to modify glyph metrics during layout. The values returned by the delegate are applied to each glyph in the run or runs corresponding to the attribute containing that delegate.

See [`CTRunDelegate`](/documentation/CoreText/CTRunDelegate) for a discussion of the function-pointer types associated with these callbacks.

## Topics

### Initializers

[`init(version:dealloc:getAscent:getDescent:getWidth:)`](/documentation/CoreText/CTRunDelegateCallbacks/init(version:dealloc:getAscent:getDescent:getWidth:))

### Instance Properties

[`dealloc`](/documentation/CoreText/CTRunDelegateCallbacks/dealloc)

The callback invoked when the retain count of a CTRunDelegate reaches 0 and the CTRunDelegate is deallocated. This callback may be `NULL`.

[`getAscent`](/documentation/CoreText/CTRunDelegateCallbacks/getAscent)

The callback invoked to request the run delegate to determine and return the typographic ascent of glyphs in the run. This callback may be `NULL`, which is equivalent to a `getAscent` callback that always returns 0.

[`getDescent`](/documentation/CoreText/CTRunDelegateCallbacks/getDescent)

The callback invoked to request the run delegate to determine and return the typographic descent of glyphs in the run. This callback may be `NULL`, which is equivalent to a `getDescent` callback that always returns 0.

[`getWidth`](/documentation/CoreText/CTRunDelegateCallbacks/getWidth)

The callback invoked to request the run delegate to determine and return the typographic width of glyphs in the run. This callback may be `NULL`, which is equivalent to a `getWidth` callback that always returns 0.

[`version`](/documentation/CoreText/CTRunDelegateCallbacks/version)

The version number of the callbacks being passed in as a parameter to [`CTRunDelegateCreate(_:_:)`](/documentation/CoreText/CTRunDelegateCreate(_:_:)). The initial version is [`kCTRunDelegateVersion1`](/documentation/CoreText/kCTRunDelegateVersion1).



---

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)