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

# convert(_:toNotHaveTrait:)

Returns a new version of a font object without the specified traits.

```
func convert(_ fontObj: NSFont, toNotHaveTrait trait: NSFontTraitMask) -> NSFont
```

## Parameters

`fontObj`

The font whose traits are matched.

`trait`

The mask for the traits to remove, created using the C bitwise OR operator to combine the traits described in `Constants`. Using [`boldFontMask`](/documentation/AppKit/NSFontTraitMask/boldFontMask) or [`italicFontMask`](/documentation/AppKit/NSFontTraitMask/italicFontMask) removes the bold or italic trait, respectively.

## Return Value

A font with matching traits minus the given traits, or `aFont` if it can’t be converted.

## See Also

[`convert(_:)`](/documentation/AppKit/NSFontManager/convert(_:))

Converts the given font according to the object that initiated a font change, typically the Font panel or 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)