Mac Developer Library

Developer

Core Text Reference Collection CTFontCollection Reference

Options
Deployment Target:

On This Page
Language:

CTFontCollection Reference

The CTFontCollection opaque type represents a font collection, that is, a group of font descriptors taken together as a single object.

Font collections provide the capabilities of font enumeration, access to global and custom font collections, and access to the font descriptors comprising the collection.

Functions

Data Types

  • A reference to a font collection.

    Declaration

    Swift

    class CTFontCollection { }

    Objective-C

    typedef const struct __CTFontCollection * CTFontCollectionRef;

    Import Statement

    Objective-C

    @import CoreText;

    Swift

    import CoreText

    Availability

    Available in OS X v10.5 and later.

  • A reference to a mutable font collection.

    Declaration

    Swift

    class CTMutableFontCollection { }

    Objective-C

    typedef struct __CTFontCollection * CTMutableFontCollectionRef;

    Discussion

    An opaque reference to a mutable font collection.

    Import Statement

    Objective-C

    @import CoreText;

    Swift

    import CoreText

    Availability

    Available in OS X v10.7 and later.

Constants

  • An option key to specify filtering of duplicates.

    Declaration

    Swift

    let kCTFontCollectionRemoveDuplicatesOption: CFString

    Objective-C

    const CFStringRef kCTFontCollectionRemoveDuplicatesOption;

    Constants

    • kCTFontCollectionRemoveDuplicatesOption

      kCTFontCollectionRemoveDuplicatesOption

      Option key to specify filtering of duplicates.

      Available in OS X v10.5 and later.

    Discussion

    Specify this option key in the options dictionary with a nonzero value to enable automatic filtering of duplicate font descriptors.

  • Option bits for use with CTFontCollectionCopyFontAttribute(s).

    Declaration

    Swift

    struct CTFontCollectionCopyOptions : OptionSetType { init(rawValue rawValue: UInt32) static var DefaultOptions: CTFontCollectionCopyOptions { get } static var Unique: CTFontCollectionCopyOptions { get } static var StandardSort: CTFontCollectionCopyOptions { get } }

    Objective-C

    enum { kCTFontCollectionCopyDefaultOptions = 0, kCTFontCollectionCopyUnique = (1L << 0), kCTFontCollectionCopyStandardSort = (1L << 1) }; typedef uint32_t CTFontCollectionCopyOptions;

    Constants

    • DefaultOptions

      kCTFontCollectionCopyDefaultOptions

      Passing this option indicates that defaults are to be used.

      Available in OS X v10.7 and later.

    • StandardSort

      kCTFontCollectionCopyStandardSort

      Passing this option indicates that the return values should be sorted in standard UI order, suitable for display to the user. This is the same sorting behavior used by NSFontPanel and Font Book.

      Available in OS X v10.7 and later.

    • Unique

      kCTFontCollectionCopyUnique

      Passing this option indicates that duplicate values should be removed from the results.

      Available in OS X v10.7 and later.

    Import Statement

    Objective-C

    @import CoreText;

    Swift

    import CoreText

    Availability

    Available in OS X v10.7 and later.