Mac Developer Library

Developer

Core Text Reference Collection CTGlyphInfo Reference

Options
Deployment Target:

On This Page
Language:

CTGlyphInfo Reference

The CTGlyphInfo opaque type enables you to override a font's specified mapping from Unicode to the glyph ID.

Functions

  • Creates an immutable glyph info object with a glyph name.

    Declaration

    Swift

    func CTGlyphInfoCreateWithGlyphName(_ glyphName: CFString, _ font: CTFont, _ baseString: CFString) -> CTGlyphInfo

    Objective-C

    CTGlyphInfoRef CTGlyphInfoCreateWithGlyphName ( CFStringRef glyphName, CTFontRef font, CFStringRef baseString );

    Parameters

    glyphName

    The name of the glyph.

    font

    The font to be associated with the returned CTGlyphInfo object.

    baseString

    The part of the string the returned object is intended to override.

    Return Value

    A valid reference to an immutable CTGlyphInfo object if glyph info creation was successful; otherwise, NULL.

    Discussion

    This function creates an immutable glyph info object for a glyph name such as copyright using a specified font.

    Availability

    Available in OS X v10.5 and later.

  • Creates an immutable glyph info object with a glyph index.

    Declaration

    Swift

    func CTGlyphInfoCreateWithGlyph(_ glyph: CGGlyph, _ font: CTFont, _ baseString: CFString) -> CTGlyphInfo

    Objective-C

    CTGlyphInfoRef CTGlyphInfoCreateWithGlyph ( CGGlyph glyph, CTFontRef font, CFStringRef baseString );

    Parameters

    glyph

    The index of the glyph.

    font

    The font to be associated with the returned CTGlyphInfo object.

    baseString

    The part of the string the returned object is intended to override.

    Return Value

    A valid reference to an immutable CTGlyphInfo object, If glyph info creation was successful; otherwise, NULL.

    Discussion

    This function creates an immutable glyph info object for a glyph index using a specified font.

    Availability

    Available in OS X v10.5 and later.

  • Creates an immutable glyph info object with a character identifier.

    Declaration

    Swift

    func CTGlyphInfoCreateWithCharacterIdentifier(_ cid: CGFontIndex, _ collection: CTCharacterCollection, _ baseString: CFString) -> CTGlyphInfo

    Objective-C

    CTGlyphInfoRef CTGlyphInfoCreateWithCharacterIdentifier ( CGFontIndex cid, CTCharacterCollection collection, CFStringRef baseString );

    Parameters

    cid

    A character identifier.

    collection

    A character collection identifier.

    baseString

    The part of the string the returned object is intended to override.

    Return Value

    A valid reference to an immutable CTGlyphInfo object if glyph info creation was successful; otherwise, NULL.

    Discussion

    This function creates an immutable glyph info object for a character identifier and a character collection.

    Availability

    Available in OS X v10.5 and later.

Data Types

  • A reference to a glyph info object.

    Declaration

    Swift

    class CTGlyphInfo { }

    Objective-C

    typedef const struct __CTGlyphInfo *CTGlyphInfoRef;

    Availability

    Available in OS X v10.5 and later.

Constants

  • These constants specify character collections.

    Declaration

    Swift

    enum CTCharacterCollection : UInt16 { case IdentityMapping case AdobeCNS1 case AdobeGB1 case AdobeJapan1 case AdobeJapan2 case AdobeKorea1 static var kCTIdentityMappingCharacterCollection: CTCharacterCollection { get } static var kCTAdobeCNS1CharacterCollection: CTCharacterCollection { get } static var kCTAdobeGB1CharacterCollection: CTCharacterCollection { get } static var kCTAdobeJapan1CharacterCollection: CTCharacterCollection { get } static var kCTAdobeJapan2CharacterCollection: CTCharacterCollection { get } static var kCTAdobeKorea1CharacterCollection: CTCharacterCollection { get } }

    Objective-C

    enum{ kCTIdentityMappingCharacterCollection = 0, kCTAdobeCNS1CharacterCollection = 1, kCTAdobeGB1CharacterCollection = 2, kCTAdobeJapan1CharacterCollection = 3, kCTAdobeJapan2CharacterCollection = 4, kCTAdobeKorea1CharacterCollection = 5}; typedef uint16_t CTCharacterCollection;

    Constants

    • kCTIdentityMappingCharacterCollection

      kCTIdentityMappingCharacterCollection

      The character identifier is equal to the CGGlyph glyph index.

      Available in OS X v10.5 and later.

      Deprecated in OS X v10.11.

    • kCTAdobeCNS1CharacterCollection

      kCTAdobeCNS1CharacterCollection

      The Adobe-CNS1 mapping.

      Available in OS X v10.5 and later.

      Deprecated in OS X v10.11.

    • kCTAdobeGB1CharacterCollection

      kCTAdobeGB1CharacterCollection

      The Adobe-GB1 mapping.

      Available in OS X v10.5 and later.

      Deprecated in OS X v10.11.

    • kCTAdobeJapan1CharacterCollection

      kCTAdobeJapan1CharacterCollection

      The Adobe-Japan1 mapping.

      Available in OS X v10.5 and later.

      Deprecated in OS X v10.11.

    • kCTAdobeJapan2CharacterCollection

      kCTAdobeJapan2CharacterCollection

      The Adobe-Japan2 mapping.

      Available in OS X v10.5 and later.

      Deprecated in OS X v10.11.

    • kCTAdobeKorea1CharacterCollection

      kCTAdobeKorea1CharacterCollection

      The Adobe-Korea1 mapping.

      Available in OS X v10.5 and later.

      Deprecated in OS X v10.11.

    Import Statement

    Objective-C

    @import CoreText;

    Swift

    import CoreText

    Availability

    Available in OS X v10.5 and later.