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

# convert(_:toFace:)

Returns a font whose traits are as similar as possible to those of the given font except for the typeface, which is changed to the given typeface.

```
func convert(_ fontObj: NSFont, toFace typeface: String) -> NSFont?
```

## Parameters

`fontObj`

The font whose traits are matched.

`typeface`

The new typeface; a fully specified family-face name, such as Helvetica-BoldOblique or Times-Roman.

## Return Value

A font with matching traits and the given typeface, or `aFont` if it can’t be converted.

## Discussion

This method attempts to match the weight and posture of `aFont` as closely as possible. Italic is mapped to Oblique, for example. Weights are mapped based on an approximate numeric scale of 0 to 15.

## See Also

[`-  convertFont:`](/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)