---
title: "makeAttributedString(font:)"
framework: tvmlkit
role: symbol
role_heading: Instance Method
path: "tvmlkit/tvtextelement/makeattributedstring(font:)"
---

# makeAttributedString(font:)

Provides an attributed string for a given font.

## Declaration

```swift
func makeAttributedString(font: UIFont) -> NSAttributedString
```

## Parameters

- `font`: The font used for the attributed string. This can be any available font on the device.

## Return Value

Return Value An NSAttributedString object with the supplied font.

## Discussion

Discussion Supply a font to this method to get the NSAttributedString representation of the text contained within an element.

## See Also

### Creating Attributed Strings

- [makeAttributedString(font:foregroundColor:textAlignment:)](tvmlkit/tvtextelement/makeattributedstring(font:foregroundcolor:textalignment:).md)
