Platforms to show: All Mac Windows Linux Cross-Platform

Back to CTFramesetterMBS class.

CTFramesetterMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
The private constructor.

CTFramesetterMBS.CreateFrame(location as Integer, length as Integer, path as CGPathMBS, frameAttributes as dictionary = nil) as CTFrameMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an immutable frame using a framesetter.

location and length: 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. The path may be non-rectangular in versions of OS X v10.7 or later and versions of iOS 4.2 or later.
frameAttributes: Additional attributes that control the frame filling process can be specified here, or nil if there are no such attributes.

Returns a reference to a new CTFrame object if the call was successful; otherwise, nil.

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.

Special Considerations
In versions of OS X prior to 10.7 and versions of iOS prior to 4.2, this function returns NULL if the CGPath specified by the path parameter is not rectangular.

Some examples using this method:

CTFramesetterMBS.SuggestFrameSizeWithConstraints(location as Integer, length as Integer, frameAttributes as dictionary, constraints as CGSizeMBS, byref fitRangeLocation as Integer, byref fitRangeLength as Integer) as CGSizeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Determines the frame size needed for a string range.

location and length: The string range to which the frame size applies. The string range is a range over the string used to create the framesetter. 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.
frameAttributes: Additional attributes that control the frame filling process, or NULL if there are no such attributes.
constraints: The width and height to which the frame size is constrained. A value of CGFLOAT_MAX for either dimension indicates that it should be treated as unconstrained.
fitRange: On return, contains the range of the string that actually fit in the constrained size.

Returns the actual dimensions for the given string range and constraints.

This function can be used to determine how much space is needed to display a string, optionally by constraining the space along either dimension.
Available in OS X v10.5 and later.

Some examples using this method:

The items on this page are in the following plugins: MBS MacCG Plugin.


The biggest plugin in space...