<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSGlyphGenerator",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSGlyphGenerator"
  },
  "title" : "NSGlyphGenerator"
}
-->

# NSGlyphGenerator

An object that performs the initial, nominal glyph generation phase in the layout process.

```
class NSGlyphGenerator
```

## Overview

The nominal glyph generation pass essentially generates one glyph per character; the typesetter may later make substitutions in the glyph stream, for example, changing an acute accent glyph followed by an “e” glyph into a single acute-accented “é” glyph.

[`NSGlyphGenerator`](/documentation/AppKit/NSGlyphGenerator) communicates via the [`NSGlyphStorage`](/documentation/AppKit/NSGlyphStorage) protocol. An example of a class that conforms to the protocol is [`NSLayoutManager`](/documentation/AppKit/NSLayoutManager).

## Topics

### Obtaining a glyph generator

[`shared`](/documentation/AppKit/NSGlyphGenerator/shared)

Returns a shared instance of `NSGlyphGenerator`.

### Generating glyphs

[`generateGlyphs(for:desiredNumberOfCharacters:glyphIndex:characterIndex:)`](/documentation/AppKit/NSGlyphGenerator/generateGlyphs(for:desiredNumberOfCharacters:glyphIndex:characterIndex:))

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



---

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)