<!--
{
  "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/CTRunGetTextMatrix(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTRunGetTextMatrix"
  },
  "title" : "CTRunGetTextMatrix(_:)"
}
-->

# CTRunGetTextMatrix(_:)

Returns the text matrix needed to draw this run.

```
func CTRunGetTextMatrix(_ run: CTRun) -> CGAffineTransform
```

## Parameters

`run`

The run object from which to get the text matrix.

## Return Value

A <doc://com.apple.documentation/documentation/CoreFoundation/CGAffineTransform> structure.

## Discussion

To properly draw the glyphs in a run, the fields `tx` and `ty` of the <doc://com.apple.documentation/documentation/CoreFoundation/CGAffineTransform> returned by this function should be set to the current text position.

---

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)