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

# convert(_:toSize:)

Returns a font object whose traits are the same as those of the given font, except for the size, which is changed to the given size.

```
func convert(_ fontObj: NSFont, toSize size: CGFloat) -> NSFont
```

## Parameters

`fontObj`

The font whose traits are matched.

`size`

The new font size.

## Return Value

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

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