<!--
{
  "availability" : [
    "iOS: 8.2.0 -",
    "iPadOS: 8.2.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIFont/systemFont(ofSize:weight:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIFont(cm)systemFontOfSize:weight:"
  },
  "title" : "systemFont(ofSize:weight:)"
}
-->

# systemFont(ofSize:weight:)

Returns the font object for standard interface items in the specified size and weight.

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

## Parameters

`fontSize`

The size (in points) to which the font is scaled. This value must be greater than 0.0.

`weight`

The weight of the font, specified as a font weight constant. For a list of possible values, see “Font Weights” in [`UIFontDescriptor`](/documentation/UIKit/UIFontDescriptor). Avoid passing an arbitrary floating-point number for `weight`, because a font might not include a variant for every weight.

## Return Value

A font object of the specified size and weight.

## Discussion

Instead of using this method to get a font, it’s often more appropriate to use [`preferredFont(forTextStyle:)`](/documentation/UIKit/UIFont/preferredFont(forTextStyle:)) because that method respects the user’s selected content size category.

---

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)