Calculates the advances for an array of glyphs and returns the summed advance.
SDKs
- iOS 3.2+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Text
Declaration
double CTFontGetAdvancesForGlyphs(CTFont Ref font, CTFont Orientation orientation, const CGGlyph *glyphs, CGSize *advances, CFIndex count);
Parameters
font
The font reference.
orientation
The intended drawing orientation of the glyphs. Used to determined which glyph metrics to return.
glyphs
An array of
count
number of glyphs.advances
An array of
count
number ofCGSize
objects to receive the computed glyph advances. IfNULL
, only the overall advance is calculated.count
The capacity of the
glyphs
andadvances
buffers.
Return Value
The summed glyph advance of an array of glyphs.
Discussion
Individual glyph advances are passed back via the advances
parameter. These are the ideal metrics for each glyph scaled and transformed in font space.