---
title: "CTRunGetTextMatrix(_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctrungettextmatrix(_:)"
---

# CTRunGetTextMatrix(_:)

Returns the text matrix needed to draw this run.

## Declaration

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

## Parameters

- `run`: The run object from which to get the text matrix.

## Return Value

Return Value A CGAffineTransform structure.

## Discussion

Discussion To properly draw the glyphs in a run, the fields tx and ty of the CGAffineTransform returned by this function should be set to the current text position.

## See Also

### Drawing the Glyph Run

- [CTRunDraw(_:_:_:)](coretext/ctrundraw(_:_:_:).md)
