---
title: "fixFontAttribute(in:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutableattributedstring/fixfontattribute(in:)"
---

# fixFontAttribute(in:)

Fixes the font attribute in the specified range and assigns default fonts where appropriate.

## Declaration

```swift
func fixFontAttribute(in range: NSRange)
```

## Parameters

- `range`: The range of characters.

## Discussion

Discussion This method assigns default fonts to characters with illegal fonts for their scripts and corrects other font attribute assignments. For example, Kanji characters assigned a Latin font are reassigned an appropriate Kanji font. Raises an rangeException if any part of range lies beyond the end of the receiver’s characters.

## See Also

### Fixing Attributes After Changes

- [fixAttributes(in:)](foundation/nsmutableattributedstring/fixattributes(in:).md)
- [fixAttachmentAttribute(in:)](foundation/nsmutableattributedstring/fixattachmentattribute(in:).md)
- [fixParagraphStyleAttribute(in:)](foundation/nsmutableattributedstring/fixparagraphstyleattribute(in:).md)
