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

# convertWeight(_:of:)

Returns a font object whose weight is greater or lesser than that of the given font.

```
func convertWeight(_ upFlag: Bool, of fontObj: NSFont) -> NSFont
```

## Parameters

`upFlag`

If <doc://com.apple.documentation/documentation/Swift/true>, a heavier font is returned; if it’s <doc://com.apple.documentation/documentation/Swift/false>, a lighter font is returned.

`fontObj`

The font whose weight is increased or decreased.

## Return Value

A font with matching traits except for the new weight, or `aFont` if it can’t be converted.

## Discussion

Weights are graded along the following scale. The list on the left gives Apple’s terminology, and the list on the right gives the ISO equivalents. Names on the same line are treated as identical:

|Apple Terminology                |ISO Equivalent|
|---------------------------------|--------------|
|1. ultralight                    |              |
|2. thin                          |W1. ultralight|
|3. light, extralight             |W2. extralight|
|4. book                          |W3. light     |
|5. regular, plain, display, roman|W4. semilight |
|6. medium                        |W5. medium    |
|7. demi, demibold                |              |
|8. semi, semibold                |W6. semibold  |
|9. bold                          |W7. bold      |
|10. extra, extrabold             |W8. extrabold |
|11. heavy, heavyface             |              |
|12. black, super                 |W9. ultrabold |
|13. ultra, ultrablack, fat       |              |
|14. extrablack, obese, nord      |              |

The `NSFontManager` implementation of this method refuses to convert a font’s weight if it can’t maintain all other traits, such as italic and condensed. You might wish to override this method to allow a looser interpretation of weight conversion.

## 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)