<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIFontDescriptor/TraitKey",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@T@UIFontDescriptorTraitKey"
  },
  "title" : "UIFontDescriptor.TraitKey"
}
-->

# UIFontDescriptor.TraitKey

Keys for retrieving the font descriptor’s trait information.

```
struct TraitKey
```

## Overview

Use these keys to fetch values from the dictionary associated with the [`traits`](/documentation/UIKit/UIFontDescriptor/AttributeName/traits) key.

## Topics

### Font traits

[`static let slant: UIFontDescriptor.TraitKey`](/documentation/UIKit/UIFontDescriptor/TraitKey/slant)

The relative slant angle of the font.

[`static let symbolic: UIFontDescriptor.TraitKey`](/documentation/UIKit/UIFontDescriptor/TraitKey/symbolic)

The symbolic font traits.

[`static let weight: UIFontDescriptor.TraitKey`](/documentation/UIKit/UIFontDescriptor/TraitKey/weight)

The numerical value that corresponds to a font face.

[`static let width: UIFontDescriptor.TraitKey`](/documentation/UIKit/UIFontDescriptor/TraitKey/width)

The inter-glyph spacing of the font.

### Initializer

[`init(rawValue: String)`](/documentation/UIKit/UIFontDescriptor/TraitKey/init(rawValue:))

Creates a font trait key with the specified raw value.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

---

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)