---
title: "systemFont(ofSize:weight:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsfont/systemfont(ofsize:weight:)"
---

# systemFont(ofSize:weight:)

Returns the standard system font with the specified size and weight.

## Declaration

```swift
class func systemFont(ofSize fontSize: CGFloat, weight: NSFont.Weight) -> NSFont
```

## Parameters

- `fontSize`: The desired font size specified in points. If you specify 0.0 or a negative number for this parameter, the method returns the system font at the default size.
- `weight`: The desired weight of font lines, specified as one of the constants in doc://com.apple.appkit/documentation/AppKit/NSFont/Weight.

## Return Value

Return Value A font object containing the system font at the specified size and weight.

## Discussion

Discussion Use the returned font for standard interface items, including button labels, menu items, and so on that require a specific font style information.

## See Also

### Creating System Fonts

- [preferredFont(forTextStyle:options:)](appkit/nsfont/preferredfont(fortextstyle:options:).md)
- [systemFont(ofSize:)](appkit/nsfont/systemfont(ofsize:).md)
- [boldSystemFont(ofSize:)](appkit/nsfont/boldsystemfont(ofsize:).md)
- [monospacedSystemFont(ofSize:weight:)](appkit/nsfont/monospacedsystemfont(ofsize:weight:).md)
- [monospacedDigitSystemFont(ofSize:weight:)](appkit/nsfont/monospaceddigitsystemfont(ofsize:weight:).md)
- [systemFontSize](appkit/nsfont/systemfontsize.md)
- [smallSystemFontSize](appkit/nsfont/smallsystemfontsize.md)
- [NSFont.Weight](appkit/nsfont/weight.md)
- [NSFont.TextStyle](appkit/nsfont/textstyle.md)
- [NSFont.TextStyleOptionKey](appkit/nsfont/textstyleoptionkey.md)
