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


func CTFontGetBoundingRectsForGlyphs(_ font: CTFont, _ orientation: CTFontOrientation, _ glyphs: UnsafePointer<CGGlyph>, _ boundingRects: UnsafeMutablePointer<CGRect>?, _ count: CFIndex) -> CGRect



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.


On output, the computed glyph rectangles in an array of count number of CGRect objects. If NULL, only the overall bounding rectangle is calculated.


The capacity of the glyphs and boundingRects buffers.

Return Value

The overall bounding rectangle for an array or run of glyphs. Returns null on error.


The bounding rectangles of the individual glyphs are returned through the boundingRects parameter. These are the design metrics from the font 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 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.