Function

CGContextShowText

Displays a character array at the current text position, a point specified by the current text matrix.

Declaration

void CGContextShowText(CGContextRef c, const char *string, size_t length);

Parameters

c

A graphics context.

string

An array of characters to draw.

length

The length of the array specified in the bytes parameter.

Discussion

Core Graphics uses font data provided by the system to map each byte of the array through the encoding vector of the current font to obtain the glyph to display. Note that the font must have been set using CGContextSelectFont. Don’t use CGContextShowText in conjunction with CGContextSetFont.

See Also

Drawing Text

CGContextGetTextMatrix

Returns the current text matrix.

CGContextGetTextPosition

Returns the location at which text is drawn.

CGContextSelectFont

Sets the font and font size in a graphics context.

Deprecated
CGContextSetCharacterSpacing

Sets the current character spacing.

CGContextSetFont

Sets the platform font in a graphics context.

CGContextSetFontSize

Sets the current font size.

CGContextSetTextDrawingMode

Sets the current text drawing mode.

CGContextSetTextMatrix

Sets the current text matrix.

CGContextSetTextPosition

Sets the location at which text is drawn.

CGContextShowTextAtPoint

Displays a character string at a position you specify.

Deprecated