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

# insertGlyphs(_:length:forStartingGlyphAt:characterIndex:)

Inserts the given glyphs into the glyph cache at the given index and maps them to characters beginning at the given character index.

```
func insertGlyphs(_ glyphs: UnsafePointer<NSGlyph>, length: Int, forStartingGlyphAt glyphIndex: Int, characterIndex charIndex: Int)
```

## Parameters

`glyphs`

The glyphs to insert.

`length`

The number of glyphs to insert.

`glyphIndex`

The index in the glyph cache to begin inserting glyphs.

`charIndex`

Index of first character to be mapped.

## Discussion

This method is part of the `NSGlyphStorage` protocol, for use by the glyph generator. It enables bulk insertion of glyphs into the glyph cache.

---

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)