---
title: "custom(_:size:)"
framework: swiftui
role: symbol
role_heading: Type Method
path: "swiftui/font/custom(_:size:)"
---

# custom(_:size:)

Create a custom font with the given name and size that scales with the body text style.

## Declaration

```swift
static func custom(_ name: String, size: CGFloat) -> Font
```

## Mentioned in

Applying custom fonts to text

## See Also

### Creating custom fonts

- [custom(_:fixedSize:)](swiftui/font/custom(_:fixedsize:).md)
- [custom(_:size:relativeTo:)](swiftui/font/custom(_:size:relativeto:).md)
