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

# setSelectedFont(_:isMultiple:)

Records the specified font as the currently selected font and updates the Font panel.

```
func setSelectedFont(_ fontObj: NSFont, isMultiple flag: Bool)
```

## Parameters

`fontObj`

The font to set as selected.

`flag`

If <doc://com.apple.documentation/documentation/Swift/true>, the Font panel indicates that more than one font is contained in the selection; if <doc://com.apple.documentation/documentation/Swift/false>, it does not.

## Discussion

An object that manipulates fonts should invoke this method whenever it becomes first responder and whenever its selection changes. It shouldn’t invoke this method in the process of handling a <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/changeFont:> message, as this causes the font manager to lose the information necessary to effect the change. After all fonts have been converted, the font manager itself records the new selected font.

---

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)