The CTRunDelegate opaque type represents a run delegate, which is assigned to a run (attribute range) to control typographic traits such glyph ascent, glyph descent, and glyph width.


The callbacks defined for CTRunDelegate objects are provided by the owner of a run delegate and are used to modify glyph metrics during layout. The values returned by the delegate are applied to each glyph in the run or runs corresponding to the attribute with that delegate.


Getting Information About a Run Delegate

func CTRunDelegateGetRefCon(CTRunDelegate) -> UnsafeMutableRawPointer

Returns a run delegate’s “refCon” value.

func CTRunDelegateGetTypeID() -> CFTypeID

Returns the type of CTRunDelegate objects.


typealias CTRunDelegateGetAscentCallback

Defines a pointer to a function that determines typographic ascent of glyphs in the run.

typealias CTRunDelegateGetDescentCallback

Defines a pointer to a function that determines typographic descent of glyphs in the run.

typealias CTRunDelegateGetWidthCallback

Defines a pointer to a function that determines the typographic width of glyphs in the run.

typealias CTRunDelegateDeallocateCallback

Defines a pointer to a function that is invoked when a CTRunDelegate object is deallocated.

Data Types

struct CTRunDelegateCallbacks

A structure holding pointers to callbacks implemented by the run delegate.

class CTRunDelegate

The type of the CTRunDelegate opaque object.


Run Delegate Versions

The version of the run delegate.

See Also

Opaque Types


The CTFont opaque type represents a Core Text font object. Font objects represent fonts to an application, providing access to characteristics of the font, such as point size, transform matrix, and other attributes. Fonts provide assistance in laying out glyphs relative to one another and are used to establish the current font when drawing in a graphics context.


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


The CTFontDescriptor opaque type represents a font descriptor, that is, a dictionary of attributes (such as name, point size, and variation) that can completely specify a font.


The CTFrame opaque type represents a frame containing multiple lines of text. The frame object is the output resulting from the text-framing process performed by a framesetter object.


The CTFramesetter opaque type is used to generate text frames. That is, CTFramesetter is an object factory for CTFrame objects.


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


The CTLine opaque type represents a line of text.


The CTParagraphStyle opaque type represents paragraph or ruler attributes in an attributed string.


The CTRun opaque type represents a glyph run, which is a set of consecutive glyphs sharing the same attributes and direction.


The CTTextTab opaque type represents a tab in a paragraph style, storing an alignment type and location.


The CTTypesetter opaque type represents a typesetter, which performs line layout.