TechnologiesGraphics, Imaging & Compositing

CoreText

iOSmacOStvOSwatchOSvisionOS

CoreText is a low-level text layout and font handling engine for laying out, shaping, and rendering Unicode text with full typographic control across iOS, macOS, tvOS, watchOS, and visionOS. You build a typesetting pipeline by passing attributed text through a CTFramesetter to produce a CTFrame, which divides the text into CTLine objects, each composed of CTRun glyph runs. Fonts are described and instantiated with CTFont, CTFontDescriptor, and CTFontCollection, while CTParagraphStyle controls alignment, line breaking, and writing direction through settings such as CTTextAlignment, CTLineBreakMode, and CTWritingDirection. For advanced typography, types like CTRubyAnnotation, CTGlyphInfo, and CTRunDelegate let you place ruby text, substitute glyphs, and reserve space for custom-drawn content within a run.

Typesetting and Layout 8

The objects that lay out attributed text into frames, lines, and glyph runs.

  • Cl
    CTFramesetter
    An object that creates frames of typeset text from an attributed string and a path.
  • Cl
    CTFrame
    An object that holds a column of laid-out text divided into lines within a defined path.
  • Cl
    CTTypesetter
    An object that performs line breaking and shaping to produce typeset lines from text.
  • Cl
    CTLine
    An object that represents a single laid-out line of text composed of glyph runs.
  • Cl
    CTRun
    An object that represents a glyph run, a contiguous range of glyphs sharing the same attributes.
  • Cl
    CTRunDelegate
    An object that supplies custom ascent, descent, and width metrics for a run of text.
  • St
    CTRunDelegateCallbacks
    @typedef CTRunDelegateCallbacks
  • St
    CTRunStatus
    @enum CTRunStatus

Fonts 5

Types for describing, matching, and instantiating fonts and font collections.

  • Cl
    CTFont
    An object that represents a font, providing access to its glyphs, metrics, traits, and encoding.
  • Cl
    CTFontDescriptor
    An object that describes a font by a dictionary of attributes for matching and instantiation.
  • Cl
    CTFontCollection
    An immutable collection of font descriptors gathered from the system or a query.
  • Cl
    CTMutableFontCollection
    A mutable font collection whose membership and query descriptors can be modified.
  • Cl
    CTGlyphInfo
    An object that maps a character to a specific glyph for glyph substitution within a run.

Paragraph and Tab Styling 7

Types that control paragraph alignment, line breaking, tabs, and writing direction.

  • Cl
    CTParagraphStyle
    An object that holds the paragraph-level style settings applied during layout.
  • St
    CTParagraphStyleSetting
    @struct CTParagraphStyleSetting
  • En
    CTParagraphStyleSpecifier
    @enum CTParagraphStyleSpecifier
  • Cl
    CTTextTab
    An object that represents a tab stop in a paragraph style with an alignment and location.
  • En
    CTTextAlignment
    @enum CTTextAlignment
  • En
    CTLineBreakMode
    @enum CTLineBreakMode
  • En
    CTWritingDirection
    @enum CTWritingDirection

Advanced Typography 5

Types for ruby annotations, adaptive images, and other advanced typographic features.

  • Cl
    CTRubyAnnotation
    An object that represents ruby text annotating a base run of characters.
  • En
    CTRubyAlignmentiOS 8.0+
    @enum CTRubyAlignment
  • En
    CTRubyOverhangiOS 8.0+
    @enum CTRubyOverhang
  • En
    CTRubyPositioniOS 8.0+
    @enum CTRubyPosition
  • Pr
    CTAdaptiveImageProviding
    A protocol for objects that supply images adapted to the rendering context within text.

Font Traits and Options 10

Option sets and enumerations that configure font lookup, traits, orientation, and format.

  • St
    CTFontOptions
    @enum CTFontOptions
  • St
    CTFontTableOptions
    Options that control how a font's raw SFNT table data is retrieved.
  • St
    CTFontCollectionCopyOptionsiOS 12.0+
    @enum CTFontCollectionCopyOptions
  • St
    CTFontSymbolicTraits
    @enum CTFontSymbolicTraits
  • St
    CTFontStylisticClass
    @enum CTFontStylisticClass
  • En
    CTFontUIFontType
    @enum UI Type constants
  • En
    CTFontOrientation
    @enum CTFontOrientation
  • En
    CTFontFormat
    @constant kCTFontFormatUnrecognized
  • En
    CTCharacterCollection
    @enum CTCharacterCollection
  • St
    FontVariation
    A structure describing a font variation that selects a point in a variable font's design space.

Font Management 4

Enumerations that control font registration scope, activation, and matching results.

  • En
    CTFontDescriptorMatchingState
    Progress state
  • En
    CTFontManagerScope
    @enum CTFontManagerScope
  • En
    CTFontManagerAutoActivationSetting
    @enum
  • En
    CTFontManagerError
    @enum

Frame and Line Geometry 6

Options and enumerations that govern frame progression, fill rules, line bounds, and truncation.

  • En
    CTFrameProgression
    @enum CTFrameProgression
  • En
    CTFramePathFillRule
    @enum CTFramePathFillRule
  • St
    CTLineBoundsOptions
    @enum CTLineBoundsOptions
  • En
    CTLineTruncationType
    @enum CTLineTruncationType
  • St
    CTUnderlineStyle
    @enum CTUnderlineStyle
  • St
    CTUnderlineStyleModifiers
    @enum CTUnderlineStyleModifiers

SFNT Lookup Structures 10

Low-level structures describing the lookup tables used within SFNT font files.

  • St
    SFNTLookupBinarySearchHeader
    A structure describing the header of a binary-search-format SFNT lookup table.
  • St
    SFNTLookupArrayHeader
    A structure describing the header of an array-format SFNT lookup table.
  • St
    SFNTLookupTrimmedArrayHeader
    A structure describing the header of a trimmed-array-format SFNT lookup table.
  • St
    SFNTLookupVectorHeader
    A structure describing the header of a vector-format SFNT lookup table.
  • St
    SFNTLookupSegment
    A structure describing a single segment within a segmented SFNT lookup table.
  • St
    SFNTLookupSegmentHeader
    A structure describing the header of a segmented SFNT lookup table.
  • St
    SFNTLookupSingle
    A structure describing a single key-value entry in an SFNT lookup table.
  • St
    SFNTLookupSingleHeader
    A structure describing the header of a single-format SFNT lookup table.
  • St
    SFNTLookupFormatSpecificHeader
    A union of the format-specific header variants for an SFNT lookup table.
  • St
    SFNTLookupTable
    A structure describing a complete SFNT lookup table that maps glyphs to values.

State Tables 9

Structures describing the finite-state machine tables used by AAT font processing.

  • St
    STHeader
    A structure describing the header of an AAT state table.
  • St
    STClassTable
    A structure mapping glyphs to classes used as input to an AAT state machine.
  • St
    STEntryZero
    A state-table entry with no per-glyph data for an AAT state machine.
  • St
    STEntryOne
    A state-table entry with one field of per-glyph data for an AAT state machine.
  • St
    STEntryTwo
    A state-table entry with two fields of per-glyph data for an AAT state machine.
  • St
    STXHeader
    A structure describing the header of an extended AAT state table.
  • St
    STXEntryZero
    An extended state-table entry with no per-glyph data for an AAT state machine.
  • St
    STXEntryOne
    An extended state-table entry with one field of per-glyph data for an AAT state machine.
  • St
    STXEntryTwo
    An extended state-table entry with two fields of per-glyph data for an AAT state machine.

Justification and Optical Bounds 15

Structures describing postcompensation justification actions and optical bounds tables.

  • St
    LcarCaretClassEntry
    A structure describing a ligature caret class entry in the lcar table.
  • St
    LcarCaretTable
    A structure describing the ligature caret table that positions carets within ligatures.
  • St
    JustPCDecompositionAction
    A structure describing a postcompensation decomposition justification action.
  • St
    JustPCConditionalAddAction
    A structure describing a conditional-add postcompensation justification action.
  • St
    JustPCDuctilityAction
    A structure describing a ductility postcompensation justification action.
  • St
    JustPCGlyphRepeatAddAction
    A structure describing a glyph-repeat-add postcompensation justification action.
  • St
    JustPCActionSubrecord
    A structure describing a single postcompensation justification action subrecord.
  • St
    JustPCAction
    A structure describing a postcompensation justification action.
  • St
    JustWidthDeltaEntry
    A structure describing a width-delta entry used in justification.
  • St
    JustWidthDeltaGroup
    A structure grouping width-delta entries used in justification.
  • St
    JustPostcompTable
    A structure describing the postcompensation portion of the justification table.
  • St
    JustDirectionTable
    A structure describing the per-direction portion of the justification table.
  • St
    JustTable
    A structure describing the AAT justification table that governs text justification.
  • St
    OpbdSideValues
    A structure describing the optical edge values for one side of a glyph.
  • St
    OpbdTable
    A structure describing the optical bounds table that adjusts glyph edge alignment.

Glyph Metamorphosis Tables 18

Structures describing the mort and morx glyph-substitution and rearrangement subtables.

  • St
    MortRearrangementSubtable
    A structure describing a glyph-rearrangement subtable in the mort metamorphosis table.
  • St
    MortContextualSubtable
    A structure describing a contextual-substitution subtable in the mort table.
  • St
    MortLigatureSubtable
    A structure describing a ligature-substitution subtable in the mort table.
  • St
    MortSwashSubtable
    A structure describing a noncontextual swash subtable in the mort table.
  • St
    MortInsertionSubtable
    A structure describing a glyph-insertion subtable in the mort table.
  • St
    MortSpecificSubtable
    A union of the format-specific subtable variants in the mort table.
  • St
    MortSubtable
    A structure describing a generic subtable in the mort metamorphosis table.
  • St
    MortFeatureEntry
    A structure describing a feature entry that enables or disables a mort subtable.
  • St
    MortChain
    A structure describing a chain of subtables in the mort metamorphosis table.
  • St
    MortTable
    A structure describing the mort glyph-metamorphosis table.
  • St
    MorxRearrangementSubtable
    A structure describing a glyph-rearrangement subtable in the extended morx table.
  • St
    MorxContextualSubtable
    A structure describing a contextual-substitution subtable in the morx table.
  • St
    MorxLigatureSubtable
    A structure describing a ligature-substitution subtable in the morx table.
  • St
    MorxInsertionSubtable
    A structure describing a glyph-insertion subtable in the morx table.
  • St
    MorxSpecificSubtable
    A union of the format-specific subtable variants in the morx table.
  • St
    MorxSubtable
    A structure describing a generic subtable in the extended morx table.
  • St
    MorxChain
    A structure describing a chain of subtables in the extended morx table.
  • St
    MorxTable
    A structure describing the extended morx glyph-metamorphosis table.

Glyph Properties and Tracking 6

Structures describing per-glyph properties and tracking adjustment tables.

  • St
    PropTable
    A structure describing the glyph properties table holding per-glyph attributes.
  • St
    PropLookupSegment
    A structure describing a segment in the glyph properties lookup table.
  • St
    PropLookupSingle
    A structure describing a single entry in the glyph properties lookup table.
  • St
    TrakTableEntry
    A structure describing a single tracking entry at a given size in the trak table.
  • St
    TrakTableData
    A structure describing the per-direction tracking data in the trak table.
  • St
    TrakTable
    A structure describing the tracking table that adjusts intercharacter spacing by size.

Kerning Tables 28

Structures describing the legacy kern and extended kerx kerning subtables.

  • St
    KernVersion0Header
    A structure describing the version-0 header of the kern kerning table.
  • St
    KernTableHeader
    A structure describing the header of the kern kerning table.
  • St
    KernKerningPair
    A structure describing a single kerning pair and its adjustment value.
  • St
    KernOrderedListEntry
    A structure describing an entry in an ordered-list kerning subtable.
  • St
    KernOrderedListHeader
    A structure describing the header of an ordered-list kerning subtable.
  • St
    KernStateHeader
    A structure describing the header of a state-machine kerning subtable.
  • St
    KernStateEntry
    A structure describing a state-machine entry in a kerning subtable.
  • St
    KernOffsetTable
    A structure describing the offset table within a kerning subtable.
  • St
    KernSimpleArrayHeader
    A structure describing the header of a simple-array kerning subtable.
  • St
    KernIndexArrayHeader
    A structure describing the header of an index-array kerning subtable.
  • St
    KernFormatSpecificHeader
    A union of the format-specific header variants for a kern subtable.
  • St
    KernVersion0SubtableHeader
    A structure describing the version-0 header of a kern subtable.
  • St
    KernSubtableHeader
    A structure describing the header of a kern kerning subtable.
  • St
    KerxTableHeader
    A structure describing the header of the extended kerx kerning table.
  • St
    KerxKerningPair
    A structure describing a single kerning pair in the extended kerx table.
  • St
    KerxOrderedListEntry
    A structure describing an entry in an ordered-list kerx subtable.
  • St
    KerxOrderedListHeader
    A structure describing the header of an ordered-list kerx subtable.
  • St
    KerxStateHeader
    A structure describing the header of a state-machine kerx subtable.
  • St
    KerxStateEntry
    A structure describing a state-machine entry in a kerx subtable.
  • St
    KerxControlPointHeader
    A structure describing the header of a control-point kerx subtable.
  • St
    KerxControlPointEntry
    A structure describing a control-point entry in a kerx subtable.
  • St
    KerxControlPointAction
    A structure describing a control-point action in a kerx subtable.
  • St
    KerxAnchorPointAction
    A structure describing an anchor-point action in a kerx subtable.
  • St
    KerxCoordinateAction
    A structure describing a coordinate action in a kerx subtable.
  • St
    KerxSimpleArrayHeader
    A structure describing the header of a simple-array kerx subtable.
  • St
    KerxIndexArrayHeader
    A structure describing the header of an index-array kerx subtable.
  • St
    KerxFormatSpecificHeader
    A union of the format-specific header variants for a kerx subtable.
  • St
    KerxSubtableHeader
    A structure describing the header of an extended kerx kerning subtable.

Baseline and Anchor Tables 15

Structures describing baseline placement, alignment, anchor points, and language tags.

  • St
    BslnFormat0Part
    A structure describing the format-0 portion of the baseline table.
  • St
    BslnFormat1Part
    A structure describing the format-1 portion of the baseline table.
  • St
    BslnFormat2Part
    A structure describing the format-2 portion of the baseline table.
  • St
    BslnFormat3Part
    A structure describing the format-3 portion of the baseline table.
  • St
    BslnFormatUnion
    A union of the format-specific portions of the baseline table.
  • St
    BslnTable
    A structure describing the baseline table that defines baseline placement for glyphs.
  • St
    ALMXHeader
    A structure describing the header of the ALMX adjusted glyph-metrics table.
  • St
    ALMXGlyphEntry
    A structure describing a single glyph entry in the ALMX metrics table.
  • St
    ROTAHeader
    A structure describing the header of the ROTA glyph-rotation table.
  • St
    ROTAGlyphEntry
    A structure describing a single glyph entry in the ROTA rotation table.
  • St
    AnchorPoint
    A structure describing an anchor point used to attach glyphs to one another.
  • St
    AnchorPointTable
    A structure describing a table of anchor points for a glyph.
  • St
    AnkrTable
    A structure describing the ankr table that holds anchor-point data for glyphs.
  • St
    LtagStringRange
    A structure describing the range of a language-tag string in the ltag table.
  • St
    LtagTable
    A structure describing the ltag table that stores language tags referenced by the font.

SFNT Font File Structures 17

Structures describing the directory, cmap, name, variation, and feature tables of SFNT fonts.

  • St
    sfntDirectoryEntry
    A structure describing a single table entry in the SFNT font directory.
  • St
    sfntDirectory
    A structure describing the SFNT font directory that indexes a font's tables.
  • St
    sfntCMapSubHeader
    A structure describing a subheader within the SFNT character-to-glyph cmap table.
  • St
    sfntCMapExtendedSubHeader
    A structure describing an extended subheader within the SFNT cmap table.
  • St
    sfntCMapEncoding
    A structure describing an encoding record within the SFNT cmap table.
  • St
    sfntCMapHeader
    A structure describing the header of the SFNT character-to-glyph cmap table.
  • St
    sfntNameRecord
    A structure describing a single name record in the SFNT name table.
  • St
    sfntNameHeader
    A structure describing the header of the SFNT name table.
  • St
    sfntVariationAxis
    A structure describing a single variation axis in a variable font.
  • St
    sfntInstance
    A structure describing a named instance of a variable font.
  • St
    sfntVariationHeader
    A structure describing the header of the SFNT font-variation table.
  • St
    sfntFontDescriptor
    A structure describing a font descriptor record within the SFNT font data.
  • St
    sfntDescriptorHeader
    A structure describing the header of the SFNT descriptor table.
  • St
    sfntFeatureName
    A structure describing a feature name record in the SFNT feature table.
  • St
    sfntFontFeatureSetting
    A structure describing a single feature setting in the SFNT feature table.
  • St
    sfntFontRunFeature
    A structure describing a run-level feature in the SFNT feature table.
  • St
    sfntFeatureHeader
    A structure describing the header of the SFNT font-feature table.

Type Aliases 53

  • Ty
    ATSFontRef
  • Ty
    CTFontTableTag
  • Ty
    CTFontCollectionSortDescriptorsCallback
    @typedef CTFontCollectionSortDescriptorsCallback
  • Ty
    CTFontPriority
  • Ty
    CTFontDescriptorProgressHandler
  • Ty
    CTRunDelegateDeallocateCallback
    @typedef CTRunDelegateDeallocateCallback
  • Ty
    CTRunDelegateGetAscentCallback
    @typedef CTRunDelegateGetAscentCallback
  • Ty
    CTRunDelegateGetDescentCallback
    @typedef CTRunDelegateGetDescentCallback
  • Ty
    CTRunDelegateGetWidthCallback
    @typedef CTRunDelegateGetWidthCallback
  • Ty
    SFNTLookupTableFormat
  • Ty
    SFNTLookupValue
  • Ty
    SFNTLookupOffset
  • Ty
    SFNTLookupKind
  • Ty
    SFNTLookupTablePtr
  • Ty
    SFNTLookupTableHandle
  • Ty
    STClass
Show 37 more
  • Ty
    STEntryIndex
  • Ty
    STXClass
  • Ty
    STXStateIndex
  • Ty
    STXEntryIndex
  • Ty
    STXClassTable
  • Ty
    LcarCaretTablePtr
  • Ty
    JustPCActionType
  • Ty
    JustificationFlags
  • Ty
    JustPCUnconditionalAddAction
  • Ty
    OpbdTableFormat
  • Ty
    MortSubtableMaskFlags
  • Ty
    MortLigatureActionEntry
  • Ty
    PropCharProperties
  • Ty
    TrakValue
  • Ty
    KernTableFormat
  • Ty
    KernSubtableInfo
  • Ty
    KernKerningValue
  • Ty
    KernArrayOffset
  • Ty
    KernTableHeaderPtr
  • Ty
    KernTableHeaderHandle
  • Ty
    KernOrderedListEntryPtr
  • Ty
    KernOffsetTablePtr
  • Ty
    KernSubtableHeaderPtr
  • Ty
    KerxSubtableCoverage
  • Ty
    KerxArrayOffset
  • Ty
    KerxTableHeaderPtr
  • Ty
    KerxTableHeaderHandle
  • Ty
    KerxOrderedListEntryPtr
  • Ty
    KerxSubtableHeaderPtr
  • Ty
    BslnBaselineClass
  • Ty
    BslnBaselineRecord
  • Ty
    BslnTableFormat
  • Ty
    BslnTablePtr
  • Ty
    FontNameCode
  • Ty
    FontPlatformCode
  • Ty
    FontScriptCode
  • Ty
    FontLanguageCode

Extends 2

AttributedStringAttributeScopes
← Graphics, Imaging & Compositing