Instance Method

drawGlyphsForGlyphRange:atPoint:

Draws the specified glyphs, which must lie completely within a single text container.

Declaration

iOS, Mac Catalyst, tvOS
- (void)drawGlyphsForGlyphRange:(NSRange)glyphsToShow atPoint:(CGPoint)origin;
macOS
- (void)drawGlyphsForGlyphRange:(NSRange)glyphsToShow atPoint:(NSPoint)origin;

Parameters

glyphsToShow

The range of glyphs that are drawn.

origin

The position of the text container in the coordinate system of the currently focused view.

Discussion

This method is called by NSTextView for drawing. You can override it to perform additional drawing, or to replace text drawing entirely, but not to change layout. You can call this method directly, but focus must already be locked on the destination view or image. This method expects the coordinate system of the view to be flipped.

This method draws the actual glyphs, including attachments, as well as any underlines or strikethoughs.

Performs glyph generation and layout if needed.

See Also

Drawing

- drawBackgroundForGlyphRange:atPoint:

Draws background marks for the specified glyphs, which must lie completely within a single text container.

- fillBackgroundRectArray:count:forCharacterRange:color:

Fills background rectangles with a color.

- showCGGlyphs:positions:count:font:textMatrix:attributes:inContext:

Renders the glyphs at the specified positions, using the specified attributes.

- underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:

Calculates subranges to be underlined for the specified glyphs and draws the underlining as appropriate.

Glyph Attributes

Attributes that are used only inside the glyph generation machinery, but must also be shared between components.

Deprecated