Instance Method

showGlyphs(_:at:)

Draws a set of glyphs at a set of corresponding positions.

Declaration

func showGlyphs(_ glyphs: [CGGlyph], at positions: [CGPoint])

Parameters

glyphs

An array of glyphs.

positions

An array positions for the glyphs. Each item in this array specifies the position at which to draw the glyph at the corresponding index in the glyphs array.

Discussion

Points in the positions array are specified in text space, so the textMatrix property defines their transformation to user space.

See Also

Drawing Text

var textMatrix: CGAffineTransform

Returns the current text matrix.

var textPosition: CGPoint

Returns the location at which text is drawn.

func selectFont(name: UnsafePointer<Int8>, size: CGFloat, textEncoding: CGTextEncoding)

Sets the font and font size in a graphics context.

Deprecated
func setCharacterSpacing(CGFloat)

Sets the current character spacing.

func setFont(CGFont)

Sets the platform font in a graphics context.

func setFontSize(CGFloat)

Sets the current font size.

func setTextDrawingMode(CGTextDrawingMode)

Sets the current text drawing mode.

enum CGTextDrawingMode

Modes for rendering text.

func setAllowsFontSmoothing(Bool)

Sets whether or not to allow font smoothing for a graphics context.

func setAllowsFontSubpixelPositioning(Bool)

Sets whether or not to allow subpixel positioning for a graphics context

func setAllowsFontSubpixelQuantization(Bool)

Sets whether or not to allow subpixel quantization for a graphics context

func setShouldSmoothFonts(Bool)

Enables or disables font smoothing in a graphics context.

func setShouldSubpixelPositionFonts(Bool)

Enables or disables subpixel positioning in a graphics context.

func setShouldSubpixelQuantizeFonts(Bool)

Enables or disables subpixel quantization in a graphics context.

func showGlyphs(g: UnsafePointer<CGGlyph>?, count: Int)

Displays an array of glyphs at the current text position.

Deprecated
func showGlyphsAtPoint(x: CGFloat, y: CGFloat, glyphs: UnsafePointer<CGGlyph>?, count: Int)

Displays an array of glyphs at a position you specify.

Deprecated
func showText(string: UnsafePointer<Int8>, length: Int)

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

Deprecated
func showTextAtPoint(x: CGFloat, y: CGFloat, string: UnsafePointer<Int8>, length: Int)

Displays a character string at a position you specify.

Deprecated