<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTFontGetBoundingRectsForGlyphs(_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTFontGetBoundingRectsForGlyphs"
  },
  "title" : "CTFontGetBoundingRectsForGlyphs(_:_:_:_:_:)"
}
-->

# CTFontGetBoundingRectsForGlyphs(_:_:_:_:_:)

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
```

## 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.

`boundingRects`

On output, the computed glyph rectangles in an array of `count` number of <doc://com.apple.documentation/documentation/CoreFoundation/CGRect> objects. If `NULL`, only the overall bounding rectangle is calculated.

`count`

The capacity of the `glyphs` and `boundingRects` buffers.

## Return Value

The overall bounding rectangle for an array or run of glyphs. Returns <doc://com.apple.documentation/documentation/CoreGraphics/CGRectNull> on error.

## Discussion

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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)