<!--
{
  "availability" : [
    "macOS: 10.0.0 - 10.11.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSLayoutManager/getGlyphs(_:range:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLayoutManager(im)getGlyphs:range:"
  },
  "title" : "getGlyphs(_:range:)"
}
-->

# getGlyphs(_:range:)

Fills the passed-in buffer with a sequence of glyphs.

```
func getGlyphs(_ glyphArray: UnsafeMutablePointer<NSGlyph>?, range glyphRange: NSRange) -> Int
```

## Parameters

`glyphArray`

On output, the displayable glyphs from `glyphRange`, null-terminated. Does not include in the result any [`NSNullGlyph`](/documentation/AppKit/NSNullGlyph) or other glyphs that are not shown. The memory passed in should be large enough for at least `glyphRange.length+1` elements.

`glyphRange`

The range of glyphs from which to return the displayable glyphs.

## Return Value

The actual number of glyphs filled into the array is returned (not counting the null-termination).

## Discussion

Raises an `NSRangeException` if the range specified exceeds the bounds of the actual glyph range for the receiver. Performs glyph generation if needed.

---

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)