<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSFontDescriptor/init(name:matrix:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFontDescriptor(cm)fontDescriptorWithName:matrix:"
  },
  "title" : "init(name:matrix:)"
}
-->

# init(name:matrix:)

Returns a font descriptor with the name and matrix attributes set to the given values.

```
init(name fontName: String, matrix: AffineTransform)
```

## Parameters

`fontName`

The value for `NSFontNameAttribute`.

`matrix`

The value for `NSFontMatrixAttribute`.

## Return Value

The new font descriptor.

## See Also

[`fontDescriptorWithFontAttributes:`](/documentation/AppKit/NSFontDescriptor/fontDescriptorWithFontAttributes:)

Returns a font descriptor with a dictionary of attributes.



---

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)