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

# CTRunDelegate

A run delegate.

```
class CTRunDelegate
```

## Overview

A run delegate is assigned to a run (attribute range) to control typographic traits such glyph ascent, glyph descent, and glyph width.

The callbacks defined for `CTRunDelegate` objects 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 with that delegate.

## Topics

### Creating a Run Delegate

[`CTRunDelegateCreate(_:_:)`](/documentation/CoreText/CTRunDelegateCreate(_:_:))

Creates an immutable instance of a run delegate.

### Getting Information About a Run Delegate

[`CTRunDelegateGetRefCon(_:)`](/documentation/CoreText/CTRunDelegateGetRefCon(_:))

Returns a run delegate’s “refCon” value.

[`CTRunDelegateGetTypeID()`](/documentation/CoreText/CTRunDelegateGetTypeID())

Returns the type of CTRunDelegate objects.

### Callbacks

[`CTRunDelegateGetAscentCallback`](/documentation/CoreText/CTRunDelegateGetAscentCallback)

Defines a pointer to a function that determines typographic ascent of glyphs in the run.

[`CTRunDelegateGetDescentCallback`](/documentation/CoreText/CTRunDelegateGetDescentCallback)

Defines a pointer to a function that determines typographic descent of glyphs in the run.

[`CTRunDelegateGetWidthCallback`](/documentation/CoreText/CTRunDelegateGetWidthCallback)

Defines a pointer to a function that determines the typographic width of glyphs in the run.

[`CTRunDelegateDeallocateCallback`](/documentation/CoreText/CTRunDelegateDeallocateCallback)

Defines a pointer to a function that is invoked when a CTRunDelegate object is deallocated.

### Data Types

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

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

### Constants

[Run Delegate Versions](/documentation/CoreText/1498177-run-delegate-versions)

The version of the run delegate.



---

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)