Returns the rectangle for the line fragment in which the given glyph is laid out and (optionally), by reference, the whole range of glyphs that are in that fragment.
SDKs
- iOS 7.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
Frameworks
- UIKit
- App
Kit
Declaration
func lineFragmentRect(forGlyphAt glyphIndex: Int, effectiveRange effectiveGlyphRange: NSRange Pointer?) -> CGRect
func lineFragmentRect(forGlyphAt glyphIndex: Int, effectiveRange effectiveGlyphRange: NSRange Pointer?) -> NSRect
Parameters
glyphIndex
The glyph for which to return the line fragment rectangle.
effectiveGlyphRange
If not
NULL
, on output, the range for all glyphs in the line fragment.
Return Value
The line fragment in which the given glyph is laid out.
Discussion
This method causes glyph generation and layout for the line fragment containing the specified glyph, 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.
Overriding this method is not recommended. If the the line fragment rectangle needs to be modified, that should be done at the typesetter level or by calling set
.