---
title: "traits(of:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsfontmanager/traits(of:)"
---

# traits(of:)

Returns the traits of the given font.

## Declaration

```swift
func traits(of fontObj: NSFont) -> NSFontTraitMask
```

## Parameters

- `fontObj`: The font whose traits are returned.

## Return Value

Return Value The font traits, returned as a mask created by combining values listed in Constants with the C bitwise OR operator.

## See Also

### Examining Fonts

- [fontNamed(_:hasTraits:)](appkit/nsfontmanager/fontnamed(_:hastraits:).md)
- [NSFontTraitMask](appkit/nsfonttraitmask.md)
- [weight(of:)](appkit/nsfontmanager/weight(of:).md)
