---
title: "generateGlyphs(for:desiredNumberOfCharacters:glyphIndex:characterIndex:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsglyphgenerator/generateglyphs(for:desirednumberofcharacters:glyphindex:characterindex:)"
---

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

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

## Declaration

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

## Discussion

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.
