---
title: "convert(_:toNotHaveTrait:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsfontmanager/convert(_:tonothavetrait:)"
---

# convert(_:toNotHaveTrait:)

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

## Declaration

```swift
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 doc://com.apple.appkit/documentation/AppKit/NSFontTraitMask/boldFontMask or doc://com.apple.appkit/documentation/AppKit/NSFontTraitMask/italicFontMask removes the bold or italic trait, respectively.

## Return Value

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

## See Also

### Related Documentation

- [convert(_:)](appkit/nsfontmanager/convert(_:).md)

### Converting Fonts Manually

- [convert(_:toFace:)](appkit/nsfontmanager/convert(_:toface:).md)
- [convert(_:toFamily:)](appkit/nsfontmanager/convert(_:tofamily:).md)
- [convert(_:toHaveTrait:)](appkit/nsfontmanager/convert(_:tohavetrait:).md)
- [convert(_:toSize:)](appkit/nsfontmanager/convert(_:tosize:).md)
- [convertWeight(_:of:)](appkit/nsfontmanager/convertweight(_:of:).md)
- [currentFontAction](appkit/nsfontmanager/currentfontaction.md)
- [convertFontTraits(_:)](appkit/nsfontmanager/convertfonttraits(_:).md)
