---
title: "init(fontAttributes:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nsfontdescriptor/init(fontattributes:)"
---

# init(fontAttributes:)

Initializes and returns a new font descriptor with the specified attributes.

## Declaration

```swift
init(fontAttributes attributes: [NSFontDescriptor.AttributeName : Any]? = nil)
```

## Parameters

- `attributes`: The attributes for the new font descriptor. If nil, the font descriptor’s attribute dictionary will be empty.

## Return Value

Return Value The new font descriptor.

## See Also

### Creating a Font Descriptor

- [preferredFontDescriptor(forTextStyle:options:)](appkit/nsfontdescriptor/preferredfontdescriptor(fortextstyle:options:).md)
- [init(name:matrix:)](appkit/nsfontdescriptor/init(name:matrix:).md)
- [init(name:size:)](appkit/nsfontdescriptor/init(name:size:).md)
