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.
- ClCTFramesetterAn object that creates frames of typeset text from an attributed string and a path.
- ClCTFrameAn object that holds a column of laid-out text divided into lines within a defined path.
- ClCTTypesetterAn object that performs line breaking and shaping to produce typeset lines from text.
- ClCTLineAn object that represents a single laid-out line of text composed of glyph runs.
- ClCTRunAn object that represents a glyph run, a contiguous range of glyphs sharing the same attributes.
- ClCTRunDelegateAn object that supplies custom ascent, descent, and width metrics for a run of text.
- StCTRunDelegateCallbacks@typedef CTRunDelegateCallbacks
- StCTRunStatus@enum CTRunStatus
Fonts 5
Types for describing, matching, and instantiating fonts and font collections.
- ClCTFontAn object that represents a font, providing access to its glyphs, metrics, traits, and encoding.
- ClCTFontDescriptorAn object that describes a font by a dictionary of attributes for matching and instantiation.
- ClCTFontCollectionAn immutable collection of font descriptors gathered from the system or a query.
- ClCTMutableFontCollectionA mutable font collection whose membership and query descriptors can be modified.
- ClCTGlyphInfoAn 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.
- ClCTParagraphStyleAn object that holds the paragraph-level style settings applied during layout.
- StCTParagraphStyleSetting@struct CTParagraphStyleSetting
- EnCTParagraphStyleSpecifier@enum CTParagraphStyleSpecifier
- ClCTTextTabAn object that represents a tab stop in a paragraph style with an alignment and location.
- EnCTTextAlignment@enum CTTextAlignment
- EnCTLineBreakMode@enum CTLineBreakMode
- EnCTWritingDirection@enum CTWritingDirection
Advanced Typography 5
Types for ruby annotations, adaptive images, and other advanced typographic features.
- ClCTRubyAnnotationAn object that represents ruby text annotating a base run of characters.
- EnCTRubyAlignmentiOS 8.0+@enum CTRubyAlignment
- EnCTRubyOverhangiOS 8.0+@enum CTRubyOverhang
- EnCTRubyPositioniOS 8.0+@enum CTRubyPosition
- PrCTAdaptiveImageProvidingA 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.
- StCTFontOptions@enum CTFontOptions
- StCTFontTableOptionsOptions that control how a font's raw SFNT table data is retrieved.
- StCTFontCollectionCopyOptionsiOS 12.0+@enum CTFontCollectionCopyOptions
- StCTFontSymbolicTraits@enum CTFontSymbolicTraits
- StCTFontStylisticClass@enum CTFontStylisticClass
- EnCTFontUIFontType@enum UI Type constants
- EnCTFontOrientation@enum CTFontOrientation
- EnCTFontFormat@constant kCTFontFormatUnrecognized
- EnCTCharacterCollection@enum CTCharacterCollection
- StFontVariationA 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.
- EnCTFontDescriptorMatchingStateProgress state
- EnCTFontManagerScope@enum CTFontManagerScope
- EnCTFontManagerAutoActivationSetting@enum
- EnCTFontManagerError@enum
Frame and Line Geometry 6
Options and enumerations that govern frame progression, fill rules, line bounds, and truncation.
- EnCTFrameProgression@enum CTFrameProgression
- EnCTFramePathFillRule@enum CTFramePathFillRule
- StCTLineBoundsOptions@enum CTLineBoundsOptions
- EnCTLineTruncationType@enum CTLineTruncationType
- StCTUnderlineStyle@enum CTUnderlineStyle
- StCTUnderlineStyleModifiers@enum CTUnderlineStyleModifiers
SFNT Lookup Structures 10
Low-level structures describing the lookup tables used within SFNT font files.
- StSFNTLookupBinarySearchHeaderA structure describing the header of a binary-search-format SFNT lookup table.
- StSFNTLookupArrayHeaderA structure describing the header of an array-format SFNT lookup table.
- StSFNTLookupTrimmedArrayHeaderA structure describing the header of a trimmed-array-format SFNT lookup table.
- StSFNTLookupVectorHeaderA structure describing the header of a vector-format SFNT lookup table.
- StSFNTLookupSegmentA structure describing a single segment within a segmented SFNT lookup table.
- StSFNTLookupSegmentHeaderA structure describing the header of a segmented SFNT lookup table.
- StSFNTLookupSingleA structure describing a single key-value entry in an SFNT lookup table.
- StSFNTLookupSingleHeaderA structure describing the header of a single-format SFNT lookup table.
- StSFNTLookupFormatSpecificHeaderA union of the format-specific header variants for an SFNT lookup table.
- StSFNTLookupTableA 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.
- StSTHeaderA structure describing the header of an AAT state table.
- StSTClassTableA structure mapping glyphs to classes used as input to an AAT state machine.
- StSTEntryZeroA state-table entry with no per-glyph data for an AAT state machine.
- StSTEntryOneA state-table entry with one field of per-glyph data for an AAT state machine.
- StSTEntryTwoA state-table entry with two fields of per-glyph data for an AAT state machine.
- StSTXHeaderA structure describing the header of an extended AAT state table.
- StSTXEntryZeroAn extended state-table entry with no per-glyph data for an AAT state machine.
- StSTXEntryOneAn extended state-table entry with one field of per-glyph data for an AAT state machine.
- StSTXEntryTwoAn 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.
- StLcarCaretClassEntryA structure describing a ligature caret class entry in the lcar table.
- StLcarCaretTableA structure describing the ligature caret table that positions carets within ligatures.
- StJustPCDecompositionActionA structure describing a postcompensation decomposition justification action.
- StJustPCConditionalAddActionA structure describing a conditional-add postcompensation justification action.
- StJustPCDuctilityActionA structure describing a ductility postcompensation justification action.
- StJustPCGlyphRepeatAddActionA structure describing a glyph-repeat-add postcompensation justification action.
- StJustPCActionSubrecordA structure describing a single postcompensation justification action subrecord.
- StJustPCActionA structure describing a postcompensation justification action.
- StJustWidthDeltaEntryA structure describing a width-delta entry used in justification.
- StJustWidthDeltaGroupA structure grouping width-delta entries used in justification.
- StJustPostcompTableA structure describing the postcompensation portion of the justification table.
- StJustDirectionTableA structure describing the per-direction portion of the justification table.
- StJustTableA structure describing the AAT justification table that governs text justification.
- StOpbdSideValuesA structure describing the optical edge values for one side of a glyph.
- StOpbdTableA 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.
- StMortRearrangementSubtableA structure describing a glyph-rearrangement subtable in the mort metamorphosis table.
- StMortContextualSubtableA structure describing a contextual-substitution subtable in the mort table.
- StMortLigatureSubtableA structure describing a ligature-substitution subtable in the mort table.
- StMortSwashSubtableA structure describing a noncontextual swash subtable in the mort table.
- StMortInsertionSubtableA structure describing a glyph-insertion subtable in the mort table.
- StMortSpecificSubtableA union of the format-specific subtable variants in the mort table.
- StMortSubtableA structure describing a generic subtable in the mort metamorphosis table.
- StMortFeatureEntryA structure describing a feature entry that enables or disables a mort subtable.
- StMortChainA structure describing a chain of subtables in the mort metamorphosis table.
- StMortTableA structure describing the mort glyph-metamorphosis table.
- StMorxRearrangementSubtableA structure describing a glyph-rearrangement subtable in the extended morx table.
- StMorxContextualSubtableA structure describing a contextual-substitution subtable in the morx table.
- StMorxLigatureSubtableA structure describing a ligature-substitution subtable in the morx table.
- StMorxInsertionSubtableA structure describing a glyph-insertion subtable in the morx table.
- StMorxSpecificSubtableA union of the format-specific subtable variants in the morx table.
- StMorxSubtableA structure describing a generic subtable in the extended morx table.
- StMorxChainA structure describing a chain of subtables in the extended morx table.
- StMorxTableA structure describing the extended morx glyph-metamorphosis table.
Glyph Properties and Tracking 6
Structures describing per-glyph properties and tracking adjustment tables.
- StPropTableA structure describing the glyph properties table holding per-glyph attributes.
- StPropLookupSegmentA structure describing a segment in the glyph properties lookup table.
- StPropLookupSingleA structure describing a single entry in the glyph properties lookup table.
- StTrakTableEntryA structure describing a single tracking entry at a given size in the trak table.
- StTrakTableDataA structure describing the per-direction tracking data in the trak table.
- StTrakTableA structure describing the tracking table that adjusts intercharacter spacing by size.
Kerning Tables 28
Structures describing the legacy kern and extended kerx kerning subtables.
- StKernVersion0HeaderA structure describing the version-0 header of the kern kerning table.
- StKernTableHeaderA structure describing the header of the kern kerning table.
- StKernKerningPairA structure describing a single kerning pair and its adjustment value.
- StKernOrderedListEntryA structure describing an entry in an ordered-list kerning subtable.
- StKernOrderedListHeaderA structure describing the header of an ordered-list kerning subtable.
- StKernStateHeaderA structure describing the header of a state-machine kerning subtable.
- StKernStateEntryA structure describing a state-machine entry in a kerning subtable.
- StKernOffsetTableA structure describing the offset table within a kerning subtable.
- StKernSimpleArrayHeaderA structure describing the header of a simple-array kerning subtable.
- StKernIndexArrayHeaderA structure describing the header of an index-array kerning subtable.
- StKernFormatSpecificHeaderA union of the format-specific header variants for a kern subtable.
- StKernVersion0SubtableHeaderA structure describing the version-0 header of a kern subtable.
- StKernSubtableHeaderA structure describing the header of a kern kerning subtable.
- StKerxTableHeaderA structure describing the header of the extended kerx kerning table.
- StKerxKerningPairA structure describing a single kerning pair in the extended kerx table.
- StKerxOrderedListEntryA structure describing an entry in an ordered-list kerx subtable.
- StKerxOrderedListHeaderA structure describing the header of an ordered-list kerx subtable.
- StKerxStateHeaderA structure describing the header of a state-machine kerx subtable.
- StKerxStateEntryA structure describing a state-machine entry in a kerx subtable.
- StKerxControlPointHeaderA structure describing the header of a control-point kerx subtable.
- StKerxControlPointEntryA structure describing a control-point entry in a kerx subtable.
- StKerxControlPointActionA structure describing a control-point action in a kerx subtable.
- StKerxAnchorPointActionA structure describing an anchor-point action in a kerx subtable.
- StKerxCoordinateActionA structure describing a coordinate action in a kerx subtable.
- StKerxSimpleArrayHeaderA structure describing the header of a simple-array kerx subtable.
- StKerxIndexArrayHeaderA structure describing the header of an index-array kerx subtable.
- StKerxFormatSpecificHeaderA union of the format-specific header variants for a kerx subtable.
- StKerxSubtableHeaderA 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.
- StBslnFormat0PartA structure describing the format-0 portion of the baseline table.
- StBslnFormat1PartA structure describing the format-1 portion of the baseline table.
- StBslnFormat2PartA structure describing the format-2 portion of the baseline table.
- StBslnFormat3PartA structure describing the format-3 portion of the baseline table.
- StBslnFormatUnionA union of the format-specific portions of the baseline table.
- StBslnTableA structure describing the baseline table that defines baseline placement for glyphs.
- StALMXHeaderA structure describing the header of the ALMX adjusted glyph-metrics table.
- StALMXGlyphEntryA structure describing a single glyph entry in the ALMX metrics table.
- StROTAHeaderA structure describing the header of the ROTA glyph-rotation table.
- StROTAGlyphEntryA structure describing a single glyph entry in the ROTA rotation table.
- StAnchorPointA structure describing an anchor point used to attach glyphs to one another.
- StAnchorPointTableA structure describing a table of anchor points for a glyph.
- StAnkrTableA structure describing the ankr table that holds anchor-point data for glyphs.
- StLtagStringRangeA structure describing the range of a language-tag string in the ltag table.
- StLtagTableA 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.
- StsfntDirectoryEntryA structure describing a single table entry in the SFNT font directory.
- StsfntDirectoryA structure describing the SFNT font directory that indexes a font's tables.
- StsfntCMapSubHeaderA structure describing a subheader within the SFNT character-to-glyph cmap table.
- StsfntCMapExtendedSubHeaderA structure describing an extended subheader within the SFNT cmap table.
- StsfntCMapEncodingA structure describing an encoding record within the SFNT cmap table.
- StsfntCMapHeaderA structure describing the header of the SFNT character-to-glyph cmap table.
- StsfntNameRecordA structure describing a single name record in the SFNT name table.
- StsfntNameHeaderA structure describing the header of the SFNT name table.
- StsfntVariationAxisA structure describing a single variation axis in a variable font.
- StsfntInstanceA structure describing a named instance of a variable font.
- StsfntVariationHeaderA structure describing the header of the SFNT font-variation table.
- StsfntFontDescriptorA structure describing a font descriptor record within the SFNT font data.
- StsfntDescriptorHeaderA structure describing the header of the SFNT descriptor table.
- StsfntFeatureNameA structure describing a feature name record in the SFNT feature table.
- StsfntFontFeatureSettingA structure describing a single feature setting in the SFNT feature table.
- StsfntFontRunFeatureA structure describing a run-level feature in the SFNT feature table.
- StsfntFeatureHeaderA structure describing the header of the SFNT font-feature table.
Type Aliases 53
- TyATSFontRef
- TyCTFontTableTag
- TyCTFontCollectionSortDescriptorsCallback@typedef CTFontCollectionSortDescriptorsCallback
- TyCTFontPriority
- TyCTFontDescriptorProgressHandler
- TyCTRunDelegateDeallocateCallback@typedef CTRunDelegateDeallocateCallback
- TyCTRunDelegateGetAscentCallback@typedef CTRunDelegateGetAscentCallback
- TyCTRunDelegateGetDescentCallback@typedef CTRunDelegateGetDescentCallback
- TyCTRunDelegateGetWidthCallback@typedef CTRunDelegateGetWidthCallback
- TySFNTLookupTableFormat
- TySFNTLookupValue
- TySFNTLookupOffset
- TySFNTLookupKind
- TySFNTLookupTablePtr
- TySFNTLookupTableHandle
- TySTClass
Show 37 more
- TySTEntryIndex
- TySTXClass
- TySTXStateIndex
- TySTXEntryIndex
- TySTXClassTable
- TyLcarCaretTablePtr
- TyJustPCActionType
- TyJustificationFlags
- TyJustPCUnconditionalAddAction
- TyOpbdTableFormat
- TyMortSubtableMaskFlags
- TyMortLigatureActionEntry
- TyPropCharProperties
- TyTrakValue
- TyKernTableFormat
- TyKernSubtableInfo
- TyKernKerningValue
- TyKernArrayOffset
- TyKernTableHeaderPtr
- TyKernTableHeaderHandle
- TyKernOrderedListEntryPtr
- TyKernOffsetTablePtr
- TyKernSubtableHeaderPtr
- TyKerxSubtableCoverage
- TyKerxArrayOffset
- TyKerxTableHeaderPtr
- TyKerxTableHeaderHandle
- TyKerxOrderedListEntryPtr
- TyKerxSubtableHeaderPtr
- TyBslnBaselineClass
- TyBslnBaselineRecord
- TyBslnTableFormat
- TyBslnTablePtr
- TyFontNameCode
- TyFontPlatformCode
- TyFontScriptCode
- TyFontLanguageCode