<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTFontDescriptor",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@T@CTFontDescriptorRef"
  },
  "title" : "CTFontDescriptor"
}
-->

# CTFontDescriptor

A font descriptor.

```
class CTFontDescriptor
```

## Overview

A font descriptor is a dictionary of attributes (such as name, point size, and variation) that can completely specify a font.

A font descriptor can be an incomplete specification, in which case the system chooses the most appropriate font to match the given attributes.

## Topics

### Creating Font Descriptors

[`func CTFontDescriptorCreateWithNameAndSize(CFString, CGFloat) -> CTFontDescriptor`](/documentation/CoreText/CTFontDescriptorCreateWithNameAndSize(_:_:))

Creates a new font descriptor with the provided PostScript name and size.

[`func CTFontDescriptorCreateWithAttributes(CFDictionary) -> CTFontDescriptor`](/documentation/CoreText/CTFontDescriptorCreateWithAttributes(_:))

Creates a new font descriptor reference from a dictionary of attributes.

[`func CTFontDescriptorCreateCopyWithAttributes(CTFontDescriptor, CFDictionary) -> CTFontDescriptor`](/documentation/CoreText/CTFontDescriptorCreateCopyWithAttributes(_:_:))

Creates a copy of the original font descriptor with new attributes.

[`func CTFontDescriptorCreateCopyWithVariation(CTFontDescriptor, CFNumber, CGFloat) -> CTFontDescriptor`](/documentation/CoreText/CTFontDescriptorCreateCopyWithVariation(_:_:_:))

Creates a copy of the original font descriptor with a new variation instance.

[`func CTFontDescriptorCreateCopyWithFeature(CTFontDescriptor, CFNumber, CFNumber) -> CTFontDescriptor`](/documentation/CoreText/CTFontDescriptorCreateCopyWithFeature(_:_:_:))

Copies a font descriptor with new feature settings.

[`func CTFontDescriptorCreateCopyWithFamily(CTFontDescriptor, CFString) -> CTFontDescriptor?`](/documentation/CoreText/CTFontDescriptorCreateCopyWithFamily(_:_:))

Creates a copy of the font descriptor in the specified family based on the traits of the original.

[`func CTFontDescriptorCreateCopyWithSymbolicTraits(CTFontDescriptor, CTFontSymbolicTraits, CTFontSymbolicTraits) -> CTFontDescriptor?`](/documentation/CoreText/CTFontDescriptorCreateCopyWithSymbolicTraits(_:_:_:))

Creates a copy of the font descriptor with the specified symbolic traits as the original.

[`func CTFontDescriptorCreateMatchingFontDescriptors(CTFontDescriptor, CFSet?) -> CFArray?`](/documentation/CoreText/CTFontDescriptorCreateMatchingFontDescriptors(_:_:))

Returns an array of normalized font descriptors matching the provided descriptor.

[`func CTFontDescriptorCreateMatchingFontDescriptor(CTFontDescriptor, CFSet?) -> CTFontDescriptor?`](/documentation/CoreText/CTFontDescriptorCreateMatchingFontDescriptor(_:_:))

Returns the single preferred matching font descriptor based on the original descriptor and system precedence.

### Getting Attributes

[`func CTFontDescriptorCopyAttributes(CTFontDescriptor) -> CFDictionary`](/documentation/CoreText/CTFontDescriptorCopyAttributes(_:))

Returns the attributes dictionary of the font descriptor.

[`func CTFontDescriptorCopyAttribute(CTFontDescriptor, CFString) -> CFTypeRef?`](/documentation/CoreText/CTFontDescriptorCopyAttribute(_:_:))

Returns the value associated with an arbitrary attribute.

[`func CTFontDescriptorCopyLocalizedAttribute(CTFontDescriptor, CFString, UnsafeMutablePointer<Unmanaged<CFString>?>?) -> CFTypeRef?`](/documentation/CoreText/CTFontDescriptorCopyLocalizedAttribute(_:_:_:))

Returns a localized value for the requested attribute, if available.

### Getting the Font Descriptor Type

[`func CTFontDescriptorGetTypeID() -> CFTypeID`](/documentation/CoreText/CTFontDescriptorGetTypeID())

Returns the type identifier for Core Text font descriptor references.

### Accessing Font Attributes

[Font Attributes](/documentation/CoreText/font-attributes)

The keys for accessing font attributes from a font descriptor.

[`enum CTFontOrientation`](/documentation/CoreText/CTFontOrientation)

The intended rendering orientation of the font for obtaining glyph metrics.

[`enum CTFontFormat`](/documentation/CoreText/CTFontFormat)

The recognized format of the font.

[`typealias CTFontPriority`](/documentation/CoreText/CTFontPriority)

The priority of font descriptors when resolving duplicates and sorting match results.

### Accessing Font Traits

[Font Traits](/documentation/CoreText/font-traits)

The keys for accessing font traits from a font descriptor.

[Font Class Mask Shift Constants](/documentation/CoreText/font-class-mask-shift-constants)

These constants represent the font class mask shift.

[`struct CTFontSymbolicTraits`](/documentation/CoreText/CTFontSymbolicTraits)

The symbolic representation of stylistic font attributes.

[`struct CTFontStylisticClass`](/documentation/CoreText/CTFontStylisticClass)

The stylistic class values of the font.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

---

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)