CTFontManagerCompareFontFamilyNames(_:_:_:)
A comparator function to compare font family names and sort them according to Apple guidelines.
Declaration
func CTFontManagerCompareFontFamilyNames(_ family1: UnsafeRawPointer, _ family2: UnsafeRawPointer, _ context: UnsafeMutableRawPointer?) -> CFComparisonResultParameters
- family1:
The first localized font family name to compare, as a
CFStringRefobject. - family2:
The second localized font family name to compare, as a
CFStringRefobject. - context:
Unused. Can be
NULL.
Return Value
A CFComparisonResult value indicating the sort order for the two family names. kCFComparisonResultGreatherThan if family1 is greater than family2, kCFComparisonResultLessThan if family1 is less than family2, and kCFComparisonResultEqualTo if they are equal.
Discussion
This CFComparatorFunction function compares font family names and sorts them in the Apple preferred order, accounting for foundry prefix. Family names with recognized prefixes are sorted after the unprefixed names in prefix order.
See Also
Functions
CTFontDescriptorMatchFontDescriptorsWithProgressHandler(_:_:_:)CTFontManagerCopyAvailableFontFamilyNames()CTFontManagerCopyAvailableFontURLs()CTFontManagerCopyAvailablePostScriptNames()CTFontManagerCreateFontDescriptorFromData(_:)CTFontManagerCreateFontDescriptorsFromURL(_:)CTFontManagerCreateFontRequestRunLoopSource(_:_:)CTFontManagerEnableFontDescriptors(_:_:)CTFontManagerGetAutoActivationSetting(_:)CTFontManagerGetScopeForURL(_:)CTFontManagerIsSupportedFont(_:)CTFontManagerRegisterFontsForURL(_:_:_:)CTFontManagerRegisterFontsForURLs(_:_:_:)CTFontManagerRegisterGraphicsFont(_:_:)CTFontManagerSetAutoActivationSetting(_:_:)