# `GSFont generateGlyphs:callback:`

*Instance Method*

Creates and adds glyphs for a sequence of glyph names and Unicode ranges.

## Declaration

```swift
func generateGlyphs(_ glyphNames: [String], completion callback: (@Sendable ([GSGlyph]) -> Void)? = nil)
```

```swift
func generateGlyphs(_ glyphNames: [String]) async -> [GSGlyph]
```

```objc
- (void) generateGlyphs:(NSArray<NSString *> *) glyphNames callback:(void (^)(NSArray<GSGlyph *> *glyphs)) callback;
```

```python
generateGlyphs_callback_(glyphNames: list[str], glyphs: list[GSGlyph], callback)
```

## Parameters

- `glyphNames` — Glyph names and Unicode ranges to generate.
- `callback` — Called with the added glyphs after generation succeeds.

## Discussion

A range has the form `start:end`, where both endpoints identify encoded glyphs. Conflicting names or Unicode values require user confirmation before the glyphs are added.

## See Also

### Adding and Removing Glyphs

- [`GSFont newGlyphWithName:`](/Core/GlyphsCore/GSFont/newGlyphWithName:) — Creates a glyph configured for the font without adding it to [`GSFont.glyphs`](/Core/GlyphsCore/GSFont/glyphs).
- [`GSFont newGlyphWithName:changeName:`](/Core/GlyphsCore/GSFont/newGlyphWithName:changeName:) — Creates a glyph configured for the font without adding it to [`GSFont.glyphs`](/Core/GlyphsCore/GSFont/glyphs).
- [`GSFont addGlyph:`](/Core/GlyphsCore/GSFont/addGlyph:) — Adds a glyph to the font.
- [`GSFont addGlyphFast:`](/Core/GlyphsCore/GSFont/addGlyphFast:) — Adds a glyph without undo, observer notifications, synchronization, or cache updates.
- [`GSFont addGlyphsFromArray:`](/Core/GlyphsCore/GSFont/addGlyphsFromArray:) — Adds a sequence of glyphs to the font as one undoable change.
- [`GSFont removeGlyph:`](/Core/GlyphsCore/GSFont/removeGlyph:) — Removes a glyph from the font and clears its parent.
- [`GSFont removeGlyphs:`](/Core/GlyphsCore/GSFont/removeGlyphs:) — Removes a sequence of glyphs from the font as one undoable change.

