setLineFragmentRect(_:forGlyphRange:usedRect:baselineOffset:)
Sets the line fragment rectangle where the specified glyphs are laid out.
Declaration
func setLineFragmentRect(_ fragmentRect: NSRect, forGlyphRange glyphRange: NSRange, usedRect: NSRect, baselineOffset: CGFloat)Parameters
- fragmentRect:
The line fragment rectangle where the glyphs in
glyphRangeare laid out. - glyphRange:
The range of the specified glyphs.
- usedRect:
The portion of
fragmentRect, in the NSTextContainer object’s coordinate system, that actually contains glyphs or other marks that are drawn (including the text container’s line fragment padding). TheusedRectmust be equal to or contained withinfragmentRect. - baselineOffset:
The vertical distance in pixels from the line fragment origin to the baseline on which the glyphs align.
Discussion
The exact positions of the glyphs must be set after the line fragment rectangle with setLocation:forStartOfGlyphRange:.
A subclass can override this method to interact with custom glyph storage.
See Also
Interfacing with Glyph Storage
characterRange(forGlyphRange:actualGlyphRange:)glyphRange(forCharacterRange:actualCharacterRange:)setAttachmentSize(_:forGlyphRange:)setBidiLevels(_:forGlyphRange:)setDrawsOutsideLineFragment(_:forGlyphRange:)setLocation(_:withAdvancements:forStartOfGlyphRange:)setNotShownAttribute(_:forGlyphRange:)