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

# CTRun

A glyph run.

```
class CTRun
```

## Overview

A glyph run is a set of consecutive glyphs sharing the same attributes and direction.

The typesetter creates glyph runs as it produces lines from character strings, attributes, and font objects. That is, a line is constructed of one or more glyphs runs. Glyph runs can draw themselves into a graphic context, if desired, although most users have no need to interact directly with glyph runs.

## Topics

### Getting Glyph Run Data

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

Gets the glyph count for the run.

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

Returns the attribute dictionary that was used to create the glyph run.

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

Returns the run’s status.

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

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

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

Copies a range of glyphs into a user-provided buffer.

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

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

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

Copies a range of glyph positions into a user-provided buffer.

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

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

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

Copies a range of glyph advances into a user-provided buffer.

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

Returns a direct pointer for the string indices stored in the run.

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

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

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

Gets the range of characters that originally spawned the glyphs in the run.

### Measuring the Glyph Run

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

Calculates the bounds for a line.

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

Gets the typographic bounds of the run.

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

Calculates the image bounds for a glyph range.

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

Copies a range of base advances and origins into user-provided buffers.

### Drawing the Glyph Run

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

Draws a complete run or part of one.

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

Returns the text matrix needed to draw this run.

### Getting the Type Identifier

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

Returns the Core Foundation type identifier of the run object.

### Constants

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

A bitfield that represents the disposition of the run.



---

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)