Calculates the advances for an array of glyphs and returns the summed advance.


func CTFontGetAdvancesForGlyphs(_ font: CTFont, _ orientation: CTFontOrientation, _ glyphs: UnsafePointer<CGGlyph>, _ advances: UnsafeMutablePointer<CGSize>?, _ count: CFIndex) -> Double



The font reference.


The intended drawing orientation of the glyphs. Used to determined which glyph metrics to return.


An array of count number of glyphs.


An array of count number of CGSize objects to receive the computed glyph advances. If NULL, only the overall advance is calculated.


The capacity of the glyphs and advances buffers.

Return Value

The summed glyph advance of an array of glyphs.


Individual glyph advances are passed back via the advances parameter. These are the ideal metrics for each glyph scaled and transformed in font space.

See Also

Getting Glyph Data

func CTFontGetGlyphWithName(CTFont, CFString) -> CGGlyph

Returns the CGGlyph value for the specified glyph name in the given font.

func CTFontGetBoundingRectsForGlyphs(CTFont, CTFontOrientation, UnsafePointer<CGGlyph>, UnsafeMutablePointer<CGRect>?, CFIndex) -> CGRect

Calculates the bounding rects for an array of glyphs and returns the overall bounding rectangle for the glyph run.

func CTFontGetOpticalBoundsForGlyphs(CTFont, UnsafePointer<CGGlyph>, UnsafeMutablePointer<CGRect>?, CFIndex, CFOptionFlags) -> CGRect

Calculates the optical bounds for an array of glyphs and returns the overall optical bounds for the run.

func CTFontGetVerticalTranslationsForGlyphs(CTFont, UnsafePointer<CGGlyph>, UnsafeMutablePointer<CGSize>, CFIndex)

Calculates the offset from the default (horizontal) origin to the vertical origin for an array of glyphs.