<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSFontManager/modifyFont(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFontManager(im)modifyFont:"
  },
  "title" : "modifyFont(_:)"
}
-->

# modifyFont(_:)

Modifies a trait of the font.

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

## Parameters

`sender`

The control that sent the message.

## Discussion

By default, the action message is <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/changeFont:>. This action method causes the receiver to send its action message up the responder chain.

When a responder replies by providing a font to convert in a [`convert(_:)`](/documentation/AppKit/NSFontManager/convert(_:)) message, the receiver converts the font in the manner specified by `sender`. The conversion is determined by sending a `tag` message to `sender` and invoking a corresponding method:

|Sender’s Tag             |Method Used                                                                              |
|-------------------------|-----------------------------------------------------------------------------------------|
|`NSNoFontChangeAction`   |None; the font is returned unchanged.                                                    |
|`NSViaPanelFontAction`   |The Font panel’s ``doc://com.apple.appkit/documentation/AppKit/NSFontPanel/convert(_:)``.|
|`NSAddTraitFontAction`   |``doc://com.apple.appkit/documentation/AppKit/NSFontManager/convert(_:toHaveTrait:)``.   |
|`NSRemoveTraitFontAction`|``doc://com.apple.appkit/documentation/AppKit/NSFontManager/convert(_:toNotHaveTrait:)``.|
|`NSSizeUpFontAction`     |``doc://com.apple.appkit/documentation/AppKit/NSFontManager/convert(_:toSize:)``.        |
|`NSSizeDownFontAction`   |``doc://com.apple.appkit/documentation/AppKit/NSFontManager/convert(_:toSize:)``.        |
|`NSHeavierFontAction`    |``doc://com.apple.appkit/documentation/AppKit/NSFontManager/convertWeight(_:of:)``.      |
|`NSLighterFontAction`    |``doc://com.apple.appkit/documentation/AppKit/NSFontManager/convertWeight(_:of:)``.      |

---

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)