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

# convertFontTraits(_:)

Converts font traits to a new traits mask value.

```
func convertFontTraits(_ traits: NSFontTraitMask) -> NSFontTraitMask
```

## Parameters

`traits`

The current font traits.

## Return Value

The new traits mask value to be used by [`convert(_:)`](/documentation/AppKit/NSFontManager/convert(_:)).

## Discussion

This method is intended to be invoked to query the font traits while the action message (usually <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class/changeFont:>) is being invoked when the current font action is either [`NSFontAction.addTraitFontAction`](/documentation/AppKit/NSFontAction/addTraitFontAction) or [`NSFontAction.removeTraitFontAction`](/documentation/AppKit/NSFontAction/removeTraitFontAction).

---

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)