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

# setKeyEquivalentFont(_:size:)

Sets by name and size of the font used to draw the key equivalent.

```
func setKeyEquivalentFont(_ fontName: String, size fontSize: CGFloat)
```

## Parameters

`fontName`

The name of the font to use to draw the key equivalent.

`fontSize`

The font size to use to draw the key equivalent.

## Discussion

This method redisplays the button if necessary. It does nothing if the button doesn’t have a key equivalent associated with it. The default font is the same as that used to draw the title.

## See Also

[`font`](/documentation/AppKit/NSCell/font)

The font that the cell uses to display text.



---

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)