enumerateLineFragments(forGlyphRange:using:)
Enumerates line fragments intersecting with the specified glyph range.
Declaration
func enumerateLineFragments(forGlyphRange glyphRange: NSRange, using block: @escaping (NSRect, NSRect, NSTextContainer, NSRange, UnsafeMutablePointer<ObjCBool>) -> Void)Parameters
- glyphRange:
The glyph range for which to return line fragment rectangles.
- block:
The block to apply to the glyph range. The block has five arguments:
- rect
The current line fragment rectangle.
- usedRect
The portion of the line fragment rectangle that actually contains glyphs or other marks that are drawn (including the text container’s line fragment padding).
- textContainer
The text container in which the glyphs are laid out.
- glyphRange
The range of glyphs laid out in the current line fragment.
- stop
A reference to a Boolean value. The block can set the value to True to stop further processing of the array. The stop argument is an out-only argument. You should only set this Boolean to True within the block.
Discussion
This method causes glyph generation and layout for the line fragment containing the glyphs in the specified range, or if noncontiguous layout is not enabled, for all of the text up to and including that line fragment.
Line fragment rectangles are always in container coordinates.
See Also
Performing advanced layout queries
boundingRect(forGlyphRange:in:)characterIndex(for:in:fractionOfDistanceBetweenInsertionPoints:)characterRange(forGlyphRange:actualGlyphRange:)enumerateEnclosingRects(forGlyphRange:withinSelectedGlyphRange:in:using:)fractionOfDistanceThroughGlyph(for:in:)getLineFragmentInsertionPoints(forCharacterAt:alternatePositions:inDisplayOrder:positions:characterIndexes:)glyphIndex(for:in:)glyphIndex(for:in:fractionOfDistanceThroughGlyph:)glyphRange(forBoundingRect:in:)glyphRange(forBoundingRectWithoutAdditionalLayout:in:)glyphRange(for:)glyphRange(forCharacterRange:actualCharacterRange:)range(ofNominallySpacedGlyphsContaining:)