Instance Method

showCGGlyphs:positions:count:font:matrix:attributes:inContext:

Renders the glyphs at the specified positions and attributes into the graphicsContext.

Declaration

iOS, tvOS
- (void)showCGGlyphs:(const CGGlyph *)glyphs positions:(const CGPoint *)positions count:(NSUInteger)glyphCount font:(UIFont *)font matrix:(CGAffineTransform)textMatrix attributes:(NSDictionary<NSAttributedStringKey, id> *)attributes inContext:(CGContextRef)graphicsContext;
macOS
- (void)showCGGlyphs:(const CGGlyph *)glyphs positions:(const NSPoint *)positions count:(NSUInteger)glyphCount font:(NSFont *)font matrix:(NSAffineTransform *)textMatrix attributes:(NSDictionary<NSAttributedStringKey, id> *)attributes inContext:(NSGraphicsContext *)graphicsContext;

Parameters

glyphs

The glyphs to draw; may contain embedded NULL bytes.

positions

The positions at which to draw the glyphs. In the user space coordinate system.

glyphCount

The number of glyphs.

font

The font applied to the graphics state. This value can be different from the NSFontAttributeName value in the attributes argument because of various font substitutions that the system automatically executes.

textMatrix

The affine transform mapping the text space coordinate system to the user space coordinate system. The tx and ty components of textMatrix are ignored since Quartz overrides them with the glyph positions.

attributes

A dictionary of glyph attributes. See Glyph Attributes for supported keys and values.

graphicsContext

If non-nil, graphicsContext is already configured according to the text attributes arguments: font, textMatrix, and attributes.

Discussion

NSLayoutManager invokes this primitive method unless an override implementation of the deprecated showPackedGlyphs:length:glyphRange:atPoint:font:color:printingAdjustment: method exists and this method is not overridden.

See Also

Drawing

- drawBackgroundForGlyphRange:atPoint:

Draws background marks for the given glyph range, which must lie completely within a single text container.

- drawGlyphsForGlyphRange:atPoint:

Draws the glyphs in the given glyph range, which must lie completely within a single text container.

- fillBackgroundRectArray:count:forCharacterRange:color:

Fills background rectangles with a color.

- strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:

Calculates and draws strikethrough for the glyphs in the given range.

- underlineGlyphRange:underlineType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:

Calculates subranges to be underlined for the glyphs in a given range and draws the underlining as appropriate.