Function

CGContextSelectFont

Sets the font and font size in a graphics context.

Declaration

void CGContextSelectFont(CGContextRef c, const char *name, CGFloat size, CGTextEncoding textEncoding);

Parameters

c

The graphics context for which to set the font and font size.

name

A null-terminated string that contains the PostScript name of the font to set.

size

A value that specifies the font size to set, in text space units.

textEncoding

A value that specifies the encoding used for the font. For a description of the available values, see CGTextEncoding.

See Also

Drawing Text

CGContextGetTextMatrix

Returns the current text matrix.

CGContextGetTextPosition

Returns the location at which text is drawn.

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.

CGContextShowText

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

Deprecated
CGContextShowTextAtPoint

Displays a character string at a position you specify.

Deprecated