<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTFontCopyAttribute(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTFontCopyAttribute"
  },
  "title" : "CTFontCopyAttribute(_:_:)"
}
-->

# CTFontCopyAttribute(_:_:)

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

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

## Parameters

`font`

The font reference.

`attribute`

The requested attribute.

## Return Value

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

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)