Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Next Page > Hide TOC

CTFramesetter Reference

Derived from
CFType
Framework
Declared in
CTFramesetter.h

Overview

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

The framesetter takes an attributed string object and a shape descriptor object and calls into the typesetter to create line objects that fill that shape. The output is a frame object containing an array of lines. The frame can then draw itself directly into the current graphic context.

Functions by Task

Creating a Framesetter

Creating Frames

Getting the Type Identifier

Functions

CTFramesetterCreateFrame

Creates an immutable frame using a framesetter.

CTFrameRef CTFramesetterCreateFrame( CTFramesetterRef framesetter, CFRange stringRange, CGPathRef path, CFDictionaryRef frameAttributes );

Parameters
framesetter

The framesetter used to create the frame.

stringRange

The range, of the attributed string that was used to create the framesetter, that is to be typeset in lines fitted into the frame. If the length portion of the range is set to 0, then the framesetter continues to add lines until it runs out of text or space.

path

A CGPath object that specifies the shape of the frame.

frameAttributes

Additional attributes that control the frame filling process can be specified here, or NULL if there are no such attributes.

Return Value

A reference to a new CTFrame object if the call was successful; otherwise, NULL.

Discussion

This call creates a frame full of glyphs in the shape of the path provided by the path parameter. The framesetter continues to fill the frame until it either runs out of text or it finds that text no longer fits.

Availability
Declared In
CTFramesetter.h

CTFramesetterCreateWithAttributedString

Creates an immutable framesetter object from an attributed string.

CTFramesetterRef CTFramesetterCreateWithAttributedString( CFAttributedStringRef string );

Parameters
string

The attributed string with which to construct the framesetter object.

Return Value

A reference to a CTFramesetter object if the call was successful; otherwise, NULL.

Discussion

The resultant framesetter object can be used to create and fill text frames with the CTFramesetterCreateFrame call.

Availability
Declared In
CTFramesetter.h

CTFramesetterGetTypeID

Returns the Core Foundation type identifier of the framesetter object.

CFTypeID CTFramesetterGetTypeID( void );

Availability
Declared In
CTFramesetter.h

CTFramesetterGetTypesetter

Returns the typesetter object being used by the framesetter.

CTTypesetterRef CTFramesetterGetTypesetter( CTFramesetterRef framesetter );

Parameters
framesetter

The framesetter from which a typesetter is requested.

Return Value

A reference to a CTTypesetter object if the call was successful; otherwise, NULL. The framesetter maintains a reference to the returned object, which should not be released by the caller.

Discussion

Each framesetter uses a typesetter internally to perform line breaking and other contextual analysis based on the characters in a string; this function returns the typesetter being used by a particular framesetter in case the caller would like to perform other operations on that typesetter.

Availability
Declared In
CTFramesetter.h

Data Types

CTFramesetterRef

A reference to a Core Foundation framesetter object.

typedef const struct __CTFramesetter *CTFramesetterRef;

Availability
Declared In
CTFramesetter.h

Next Page > Hide TOC


Last updated: 2007-04-21




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice