Platforms to show: All Mac Windows Linux Cross-Platform

Back to CTLineMBS class.

CTLineMBS.Bounds(options as Integer = 0) as CGRectMBS

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

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

CTLineMBS.CreateJustifiedLine(justificationFactor as Double, justificationWidth as Double) as CTLineMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a justified line from an existing line.

line: The line from which to create a justified line.
justificationFactor: Full or partial justification. When set to 1.0 or greater, full justification is performed. If this parameter is set to less than 1.0, varying degrees of partial justification are performed. If it is set to 0 or less, no justification is performed.
justificationWidth: The width to which the resultant line is justified. If justificationWidth is less than the actual width of the line, then negative justification is performed (that is, glyphs are squeezed together).

Returns a reference to a justified CTLine object if the call was successful; otherwise, nil.
Available in OS X v10.5 and later.

CTLineMBS.CreateTruncatedLine(width as Double, truncationType as Integer, truncationToken as CTLineMBS = nil) as CTLineMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a truncated line from an existing line.

line: The line from which to create a truncated line.
width: The width at which truncation begins. The line is truncated if its width is greater than the width passed in this parameter.
truncationType: The type of truncation to perform if needed. See constants for possible values.
truncationToken: This token is added at the point where truncation took place, to indicate that the line was truncated. Usually, the truncation token is the ellipsis character (U+2026). If this parameter is set to nil, then no truncation token is used and the line is simply cut off.

Returns a reference to a truncated CTLine object if the call was successful; otherwise, NULL.

The line specified in truncationToken should have a width less than the width specified by the width parameter. If the width of the line specified in truncationToken is greater than width and truncation is needed, the function returns nil.

Available in OS X v10.5 and later.

CTLineMBS.Draw(context as CGContextMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Draws a complete line.

context: The context into which the line is drawn.

This is a convenience function because the line could be drawn run-by-run by getting the glyph runs, getting the glyphs out of them, and calling a function such as CGContextMBS.ShowGlyphsAtPositions. This call can leave the graphics context in any state and does not flush the context after the draw operation.

Available in OS X v10.5 and later.

CTLineMBS.GlyphRuns as CTRunMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the array of glyph runs that make up the line object.

Returns an array containing the CTRunMBS objects that make up the line.
Available in OS X v10.5 and later.

CTLineMBS.ImageBounds(context as CGContextMBS) as CGRectMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Calculates the image bounds for a line.

context: The context for which the image bounds are calculated. This is required because the context could have settings in it that would cause changes in the image bounds.

Returns a rectangle that tightly encloses the paths of the line's glyphs, or, if the line or context is invalid, CGRectNull.
Available in OS X v10.5 and later.

CTLineMBS.OffsetForStringIndex(charIndex as Integer, byref secondaryOffset as Double) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Determines the graphical offset or offsets for a string index.

charIndex: The string index corresponding to the desired position.
secondaryOffset: On output, the secondary offset along the baseline for charIndex. When a single caret is sufficient for a string index, this value will be the same as the primary offset, which is the return value of this function. May be NULL.

Returns the primary offset along the baseline for charIndex, or 0.0 if the line does not support string access.

This function returns the graphical offset or offsets corresponding to a string index, suitable for movement between adjacent lines or for drawing a custom caret. For moving between adjacent lines, the primary offset can be adjusted for any relative indentation of the two lines; a CGPoint constructed with the adjusted offset for its x value and 0.0 for its y value is suitable for passing to CTLineGetStringIndexForPosition. For drawing a custom caret, the returned primary offset corresponds to the portion of the caret that represents the visual insertion location for a character whose direction matches the line's writing direction.

Available in OS X v10.5 and later.

CTLineMBS.PenOffsetForFlush(flushFactor as Double, flushWidth as Double) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Gets the pen offset required to draw flush text.

flushFactor: Determines the type of flushness. A flushFactor of 0 or less indicates left flush. A flushFactor of 1.0 or more indicates right flush. Flush factors between 0 and 1.0 indicate varying degrees of center flush, with a value of 0.5 being totally center flush.
flushWidth: Specifies the width to which the flushness operation should apply.

Returns the offset from the current pen position for the flush operation.
Available in OS X v10.5 and later.

CTLineMBS.StringIndexForPosition(position as CGPointMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Performs hit testing.

position: The location of the mouse click relative to the line's origin.

Returns the string index for the position, or if the line does not support string access, kCFNotFound. Relative to the line's string range, this value can be no less than the first string index and no greater than the last string index plus 1.

This function can be used to determine the string index for a mouse click or other event. This string index corresponds to the character before which the next character should be inserted. This determination is made by analyzing the string from which a typesetter was created and the corresponding glyphs as embodied by a particular line.
Available in OS X v10.5 and later.

CTLineMBS.TypographicBounds(byref ascent as Double, byref descent as Double, byref leading as Double) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreText MBS MacCG Plugin 14.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Calculates the typographic bounds of a line.

ascent: On output, the ascent of the line.
descent: On output, the descent of the line.
leading: On output, the leading of the line.

Returns the typographic width of the line. If the line is invalid, this function returns 0.

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


The biggest plugin in space...