---
title: "fontWidth(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/fontwidth(_:)"
---

# fontWidth(_:)

Sets the font width of the text in this view.

## Declaration

```swift
nonisolated func fontWidth(_ width: Font.Width?) -> some View

```

## Parameters

- `width`: One of the available font widths. Providing nil removes the effect of any font width modifier applied higher in the view hierarchy.

## Return Value

Return Value A view that uses the font width you specify.

## See Also

### Setting a font

- [Applying custom fonts to text](swiftui/applying-custom-fonts-to-text.md)
- [font(_:)](swiftui/view/font(_:).md)
- [fontDesign(_:)](swiftui/view/fontdesign(_:).md)
- [fontWeight(_:)](swiftui/view/fontweight(_:).md)
- [font](swiftui/environmentvalues/font.md)
- [Font](swiftui/font.md)
