---
title: "CTFontDescriptorCreateMatchingFontDescriptor(_:_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctfontdescriptorcreatematchingfontdescriptor(_:_:)"
---

# CTFontDescriptorCreateMatchingFontDescriptor(_:_:)

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

## Declaration

```swift
func CTFontDescriptorCreateMatchingFontDescriptor(_ descriptor: CTFontDescriptor, _ mandatoryAttributes: CFSet?) -> CTFontDescriptor?
```

## Parameters

- `descriptor`: The original font descriptor.
- `mandatoryAttributes`: A set of attribute keys which must be identically matched in any returned font descriptors. May be NULL.

## Return Value

Return Value A retained, normalized font descriptor matching the attributes present in descriptor.

## Discussion

Discussion The original descriptor may be returned in normalized form. The caller is responsible for releasing the result. In the context of font descriptors, normalized infers that the input values were matched up with actual existing fonts, and the descriptors for those existing fonts are the returned normalized descriptors.

## See Also

### Creating Font Descriptors

- [CTFontDescriptorCreateWithNameAndSize(_:_:)](coretext/ctfontdescriptorcreatewithnameandsize(_:_:).md)
- [CTFontDescriptorCreateWithAttributes(_:)](coretext/ctfontdescriptorcreatewithattributes(_:).md)
- [CTFontDescriptorCreateCopyWithAttributes(_:_:)](coretext/ctfontdescriptorcreatecopywithattributes(_:_:).md)
- [CTFontDescriptorCreateCopyWithVariation(_:_:_:)](coretext/ctfontdescriptorcreatecopywithvariation(_:_:_:).md)
- [CTFontDescriptorCreateCopyWithFeature(_:_:_:)](coretext/ctfontdescriptorcreatecopywithfeature(_:_:_:).md)
- [CTFontDescriptorCreateCopyWithFamily(_:_:)](coretext/ctfontdescriptorcreatecopywithfamily(_:_:).md)
- [CTFontDescriptorCreateCopyWithSymbolicTraits(_:_:_:)](coretext/ctfontdescriptorcreatecopywithsymbolictraits(_:_:_:).md)
- [CTFontDescriptorCreateMatchingFontDescriptors(_:_:)](coretext/ctfontdescriptorcreatematchingfontdescriptors(_:_:).md)
