<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSText/changeFont(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSText(im)changeFont:"
  },
  "title" : "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.

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

## Discussion

If the receiver doesn’t use the Font panel, this method does nothing.

This method changes the font by sending a [`convert(_:)`](/documentation/AppKit/NSFontManager/convert(_:)) message to the shared NSFontManager and applying each NSFont returned to the appropriate text. See the [`NSFontManager`](/documentation/AppKit/NSFontManager) class specification for more information on font conversion.

## See Also

[`usesFontPanel`](/documentation/AppKit/NSText/usesFontPanel)

A Boolean that controls whether the receiver uses the Font panel and Font menu.



---

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)