---
title: "withMatrix(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsfontdescriptor/withmatrix(_:)"
---

# withMatrix(_:)

Returns a new font descriptor based on the current object, but with the specified font matrix.

## Declaration

```swift
func withMatrix(_ matrix: AffineTransform) -> NSFontDescriptor
```

## Parameters

- `matrix`: The replacement font matrix.

## Return Value

Return Value The new font descriptor.

## See Also

### Modifying an Existing Font Descriptor

- [addingAttributes(_:)](appkit/nsfontdescriptor/addingattributes(_:).md)
- [withFace(_:)](appkit/nsfontdescriptor/withface(_:).md)
- [withFamily(_:)](appkit/nsfontdescriptor/withfamily(_:).md)
- [withSize(_:)](appkit/nsfontdescriptor/withsize(_:).md)
- [withSymbolicTraits(_:)](appkit/nsfontdescriptor/withsymbolictraits(_:).md)
- [withDesign(_:)](appkit/nsfontdescriptor/withdesign(_:).md)
- [NSFontDescriptor.SystemDesign](appkit/nsfontdescriptor/systemdesign.md)
