CTRun

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

Overview

The typesetter creates glyph runs as it produces lines from character strings, attributes, and font objects. That is, a line is constructed of one or more glyphs runs. Glyph runs can draw themselves into a graphic context, if desired, although most users have no need to interact directly with glyph runs.

Topics

Getting Glyph Run Data

CTRunGetGlyphCount

Gets the glyph count for the run.

CTRunGetAttributes

Returns the attribute dictionary that was used to create the glyph run.

CTRunGetStatus

Returns the run's status.

CTRunGetGlyphsPtr

Returns a direct pointer for the glyph array stored in the run.

CTRunGetGlyphs

Copies a range of glyphs into a user-provided buffer.

CTRunGetPositionsPtr

Returns a direct pointer for the glyph position array stored in the run.

CTRunGetPositions

Copies a range of glyph positions into a user-provided buffer.

CTRunGetAdvancesPtr

Returns a direct pointer for the glyph advance array stored in the run.

CTRunGetAdvances

Copies a range of glyph advances into a user-provided buffer.

CTRunGetStringIndicesPtr

Returns a direct pointer for the string indices stored in the run.

CTRunGetStringIndices

Copies a range of string indices into a user-provided buffer.

CTRunGetStringRange

Gets the range of characters that originally spawned the glyphs in the run.

Measuring the Glyph Run

CTRunGetTypographicBounds

Gets the typographic bounds of the run.

CTRunGetImageBounds

Calculates the image bounds for a glyph range.

Drawing the Glyph Run

CTRunDraw

Draws a complete run or part of one.

CTRunGetTextMatrix

Returns the text matrix needed to draw this run.

Getting the Type Identifier

CTRunGetTypeID

Returns the Core Foundation type identifier of the run object.

Data Types

CTRunRef

A reference to a run object.

Constants

CTRunStatus

A bitfield passed back by the CTRunGetStatus function that is used to indicate the disposition of the run.

See Also

Opaque Types

CTFont

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.

CTFontCollection

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

CTFontDescriptor

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.

CTFrame

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.

CTFramesetter

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

CTGlyphInfo

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

CTLine

The CTLine opaque type represents a line of text.

CTParagraphStyle

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

CTRunDelegate

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.

CTTextTab

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

CTTypesetter

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