Function

CTFontDescriptorCreateMatchingFontDescriptor

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

Declaration

CTFontDescriptorRef CTFontDescriptorCreateMatchingFontDescriptor(CTFontDescriptorRef descriptor, CFSetRef mandatoryAttributes);

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

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

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

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

CTFontDescriptorCreateWithAttributes

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

CTFontDescriptorCreateCopyWithAttributes

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

CTFontDescriptorCreateCopyWithVariation

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

CTFontDescriptorCreateCopyWithFeature

Copies a font descriptor with new feature settings.

CTFontDescriptorCreateMatchingFontDescriptors

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