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

# init(name:matrix:)

Returns a font object for the specified font name and matrix.

```
init?(name fontName: String, matrix fontMatrix: UnsafePointer<CGFloat>)
```

## Parameters

`fontName`

The fully specified family-face name of the font.

`fontMatrix`

A transformation matrix applied to the font.

## Return Value

A font object for the specified name and transformation matrix.

## Discussion

The  `fontName` is a fully specified family-face name, such as Helvetica-BoldOblique or Times-Roman (not a name as shown in the Font Panel). The `fontMatrix` is a standard 6-element transformation matrix as used in the PostScript language, specifically with the `makefont` operator. In most cases, you can simply use [`init(name:size:)`](/documentation/AppKit/NSFont/init(name:size:)) to create standard scaled fonts.

You can use the defined value `NSFontIdentityMatrix` for [1 0 0 1 0 0]. Fonts created with a matrix other than `NSFontIdentityMatrix` don’t automatically flip themselves in flipped views.

## See Also

[`flipped`](/documentation/AppKit/NSView/isFlipped)

A Boolean value indicating whether the view uses a flipped coordinate system.



---

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)