Instance Method

getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOrder:positions:characterIndexes:

Returns insertion points in bulk for a given line fragment.

Declaration

- (NSUInteger)getLineFragmentInsertionPointsForCharacterAtIndex:(NSUInteger)charIndex alternatePositions:(BOOL)aFlag inDisplayOrder:(BOOL)dFlag positions:(CGFloat *)positions characterIndexes:(NSUInteger *)charIndexes;

Parameters

charIndex

The character index of one character within the line fragment.

aFlag

If YES, returns alternate, rather than primary, insertion points.

dFlag

If YES, returns insertion points in display, rather than logical, order.

positions

On output, the positions of the insertion points, in the order specified.

charIndexes

On output, the indexes of the characters corresponding to the returned insertion points.

Return Value

The number of insertion points returned.

Discussion

The method allows clients to obtain all insertion points for a line fragment in one call. Each pointer passed in should either be NULL or else point to sufficient memory to hold as many elements as there are insertion points in the line fragment (which cannot be more than the number of characters + 1). The returned positions indicate a transverse offset relative to the line fragment rectangle's origin. Internal caching is used to ensure that repeated calls to this method for the same line fragment (possibly with differing values for other arguments) are not significantly more expensive than a single call.

See Also

Performing Advanced Layout Queries

- boundingRectForGlyphRange:inTextContainer:

Returns the bounding rectangle for the specified glyphs in a container.

- characterIndexForPoint:inTextContainer:fractionOfDistanceBetweenInsertionPoints:

Returns the index of the character falling under the given point, expressed in the given container's coordinate system.

- characterRangeForGlyphRange:actualGlyphRange:

Returns the range of characters that correspond to the glyphs in the specified glyph range.

- enumerateEnclosingRectsForGlyphRange:withinSelectedGlyphRange:inTextContainer:usingBlock:

Enumerates enclosing rectangles for the specified glyph range in a text container.

- enumerateLineFragmentsForGlyphRange:usingBlock:

Enumerates line fragments intersecting with the specified glyph range.

- fractionOfDistanceThroughGlyphForPoint:inTextContainer:

Returns the fraction of the distance between the glyph at the specified point and the next glyph.

- glyphIndexForPoint:inTextContainer:

Returns the index of the glyph at the specified location in a text container.

- glyphIndexForPoint:inTextContainer:fractionOfDistanceThroughGlyph:

Returns the index of the glyph at the specified point, expressed in the container's coordinate system.

- glyphRangeForBoundingRect:inTextContainer:

Returns the smallest contiguous range for glyphs that are laid out wholly or partially within the specified rectangle of the text container.

- glyphRangeForBoundingRectWithoutAdditionalLayout:inTextContainer:

Returns the smallest contiguous range for glyphs that are laid out wholly or partially within the specified rectangle of the text container.

- glyphRangeForTextContainer:

Returns the range of glyphs laid out within the specified text container.

- glyphRangeForCharacterRange:actualCharacterRange:

Returns the range of glyphs that are generated from the specified range of characters.

- rangeOfNominallySpacedGlyphsContainingIndex:

Returns the range of displayable glyphs that surround the glyph at the specified index.