---
title: "CTFontCopyAttribute(_:_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctfontcopyattribute(_:_:)"
---

# CTFontCopyAttribute(_:_:)

Returns the value associated with an arbitrary attribute of the given font.

## Declaration

```swift
func CTFontCopyAttribute(_ font: CTFont, _ attribute: CFString) -> CFTypeRef?
```

## Parameters

- `font`: The font reference.
- `attribute`: The requested attribute.

## Return Value

Return Value A retained reference to an arbitrary attribute or NULL if the requested attribute is not present.

## Discussion

Discussion Refer to the attribute definitions documentation for information as to how each attribute is packaged as a CFType.

## See Also

### Getting Font Data

- [CTFontCopyFontDescriptor(_:)](coretext/ctfontcopyfontdescriptor(_:).md)
- [CTFontGetSize(_:)](coretext/ctfontgetsize(_:).md)
- [CTFontGetMatrix(_:)](coretext/ctfontgetmatrix(_:).md)
- [CTFontGetSymbolicTraits(_:)](coretext/ctfontgetsymbolictraits(_:).md)
- [CTFontCopyTraits(_:)](coretext/ctfontcopytraits(_:).md)
- [CTFontCopyDefaultCascadeListForLanguages(_:_:)](coretext/ctfontcopydefaultcascadelistforlanguages(_:_:).md)
