---
title: "init(name:matrix:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nsfont/init(name:matrix:)"
---

# init(name:matrix:)

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

## Declaration

```swift
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

Return Value A font object for the specified name and transformation matrix.

## Discussion

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:) 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

### Related Documentation

- [isFlipped](appkit/nsview/isflipped.md)

### Creating Arbitrary Fonts

- [init(name:size:)](appkit/nsfont/init(name:size:).md)
- [init(descriptor:size:)](appkit/nsfont/init(descriptor:size:).md)
- [init(descriptor:textTransform:)](appkit/nsfont/init(descriptor:texttransform:).md)
