---
title: "userFont(ofSize:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsfont/userfont(ofsize:)"
---

# userFont(ofSize:)

Returns the font used by default for documents and other text under the user’s control (that is, text whose font the user can normally change), in the specified size.

## Declaration

```swift
class func userFont(ofSize fontSize: CGFloat) -> NSFont?
```

## Parameters

- `fontSize`: The size in points to which the font is scaled.

## Return Value

Return Value A font object of the specified size.

## Discussion

Discussion If fontSize is 0 or negative, returns the user font at the default size.

## See Also

### Related Documentation

- [init(name:size:)](appkit/nsfont/init(name:size:).md)
- [setUser(_:)](appkit/nsfont/setuser(_:).md)

### Creating User Fonts

- [userFixedPitchFont(ofSize:)](appkit/nsfont/userfixedpitchfont(ofsize:).md)
