---
title: "CTFontDescriptorCopyAttribute(_:_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctfontdescriptorcopyattribute(_:_:)"
---

# CTFontDescriptorCopyAttribute(_:_:)

Returns the value associated with an arbitrary attribute.

## Declaration

```swift
func CTFontDescriptorCopyAttribute(_ descriptor: CTFontDescriptor, _ attribute: CFString) -> CFTypeRef?
```

## Parameters

- `descriptor`: The font descriptor.
- `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 Accessing Font Attributes for documentation explaining how each attribute is packaged as a CFType object.

## See Also

### Getting Attributes

- [CTFontDescriptorCopyAttributes(_:)](coretext/ctfontdescriptorcopyattributes(_:).md)
- [CTFontDescriptorCopyLocalizedAttribute(_:_:_:)](coretext/ctfontdescriptorcopylocalizedattribute(_:_:_:).md)
