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.


You can draw the entire text frame directly into the current graphic context. The frame object contains an array of line objects that can be retrieved for individual rendering or to get glyph information.


Getting Frame Data

func CTFrameGetStringRange(CTFrame) -> CFRange

Returns the range of characters originally requested to fill the frame.

func CTFrameGetVisibleStringRange(CTFrame) -> CFRange

Returns the range of characters that actually fit in the frame.

func CTFrameGetPath(CTFrame) -> CGPath

Returns the path used to create the frame.

func CTFrameGetFrameAttributes(CTFrame) -> CFDictionary?

Returns the frame attributes used to create the frame.

Getting Lines

func CTFrameGetLines(CTFrame) -> CFArray

Returns an array of lines stored in the frame.

Drawing the Frame

func CTFrameDraw(CTFrame, CGContext)

Draws an entire frame into a context.

Getting the Type Identifier

func CTFrameGetTypeID() -> CFTypeID

Returns the type identifier for the CTFrame opaque type.

Data Types

class CTFrame

A reference to a Core text frame object.

enum CTFramePathFillRule

The type for constants that specify a fill rule used by a frame.


enum CTFrameProgression

These constants specify frame progression types.

CTFramePathFillRule Constants

These constants specify the fill rule used by a frame


Specifies progression for a frame.


The key used to specify the fill rule for a frame.


The key used to specify the frame width.


Specifies array of paths to clip frame.


Specifies clipping path. This attribute is valid only in a dictionary contained in an array specified by kCTFrameClippingPathsAttributeName.

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 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 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 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.