---
title: "setFontStyle(_:in:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avmutablecaption/setfontstyle(_:in:)"
---

# setFontStyle(_:in:)

Sets the font style for a range of text.

## Declaration

```swift
@nonobjc func setFontStyle(_ fontStyle: AVCaption.FontStyle, in range: NSRange)
```

## Parameters

- `fontStyle`: The font style.
- `range`: The range to which this style applies.

## See Also

### Configuring font styles

- [AVCaption.FontStyle](avfoundation/avcaption/fontstyle.md)
- [removeFontStyle(in:)](avfoundation/avmutablecaption/removefontstyle(in:).md)
- [AVCaption.FontWeight](avfoundation/avcaption/fontweight.md)
- [setFontWeight(_:in:)](avfoundation/avmutablecaption/setfontweight(_:in:).md)
- [removeFontWeight(in:)](avfoundation/avmutablecaption/removefontweight(in:).md)
- [AVCaption.Decoration](avfoundation/avcaption/decoration.md)
- [setDecoration(_:in:)](avfoundation/avmutablecaption/setdecoration(_:in:).md)
- [removeDecoration(in:)](avfoundation/avmutablecaption/removedecoration(in:).md)
