---
title: "changeFont(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstext/changefont(_:)"
---

# changeFont(_:)

This action method changes the font of the selection for a rich text object, or of all text for a plain text object.

## Declaration

```swift
func changeFont(_ sender: Any?)
```

## Discussion

Discussion If the receiver doesn’t use the Font panel, this method does nothing. This method changes the font by sending a convert(_:) message to the shared NSFontManager and applying each NSFont returned to the appropriate text. See the NSFontManager class specification for more information on font conversion.

## See Also

### Related Documentation

- [usesFontPanel](appkit/nstext/usesfontpanel.md)

### Changing the font

- [font](appkit/nstext/font.md)
- [setFont(_:range:)](appkit/nstext/setfont(_:range:).md)
