Renders the given glyphs of a font at the specified positions in the supplied graphics context.


func CTFontDrawGlyphs(_ font: CTFont, _ glyphs: UnsafePointer<CGGlyph>, _ positions: UnsafePointer<CGPoint>, _ count: Int, _ context: CGContext)



The font with glyphs to render. If the font has a size or matrix attribute, context is set with these values.


The glyphs to be rendered. The glyphs should be the result of proper Unicode text layout operations (such as with CTLine). Functions such as CTFontGetGlyphsForCharacters(_:_:_:_:) do not perform any Unicode text layout.


The positions (origins) for each glyph in glyphs. The positions are in user space. The number of positions passed in must match the number of glyphs (in glyphs).


The number of glyphs to be rendered from the glyphs array.


The graphics context used to render the glyphs.


This function modifies graphics state including font, text size, and text matrix if these attributes are specified in font. These attributes are not restored.

See Also

Working with Glyphs

func CTFontGetGlyphsForCharacters(CTFont, UnsafePointer<UniChar>, UnsafeMutablePointer<CGGlyph>, CFIndex) -> Bool

Provides basic Unicode encoding for the given font, returning by reference an array of CGGlyph values corresponding to a given array of Unicode characters for the given font.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software