<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSGlyphGenerator/generateGlyphs(for:desiredNumberOfCharacters:glyphIndex:characterIndex:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSGlyphGenerator(im)generateGlyphsForGlyphStorage:desiredNumberOfCharacters:glyphIndex:characterIndex:"
  },
  "title" : "generateGlyphs(for:desiredNumberOfCharacters:glyphIndex:characterIndex:)"
}
-->

# generateGlyphs(for:desiredNumberOfCharacters:glyphIndex:characterIndex:)

Generates glyphs for the specified glyph storage object (`NSLayoutManager` by default).

```
func generateGlyphs(for glyphStorage: any NSGlyphStorage, desiredNumberOfCharacters nChars: Int, glyphIndex: UnsafeMutablePointer<Int>?, characterIndex charIndex: UnsafeMutablePointer<Int>?)
```

## Discussion

Generates glyphs for the glyph storage object specified by `glyphStorage`, beginning with the character at `charIndex` and continuing for `nChars` characters. The `glyphIndex` specifies the index of the first glyph generated.

---

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)