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

# weight(of:)

Returns an approximation of the specified font’s weight.

```
func weight(of fontObj: NSFont) -> Int
```

## Parameters

`fontObj`

The font whose approximate weight is returned.

## Return Value

An approximation of the weight of the given font, where 0 indicates the lightest possible weight, 5 indicates a normal or book weight, and 9 or more indicates a bold or heavier weight. Because this method returns only an approximation of a font’s weight, it is not guaranteed to return the exact weight with which `fontObj` was initialized.

## Discussion

---

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)