Contents

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 glyphRange are 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). The usedRect must be equal to or contained within fragmentRect.

  • 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