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

# NSGlyphStorage

A set of methods that a glyph storage object must implement to interact properly with [`NSGlyphGenerator`](/documentation/AppKit/NSGlyphGenerator).

```
protocol NSGlyphStorage
```

## Overview

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

## Topics

### Returning text storage

[`attributedString()`](/documentation/AppKit/NSGlyphStorage/attributedString())

Returns the text storage object from which the `NSGlyphGenerator` object procures characters for glyph generation.

### Returning glyph display options

[`layoutOptions()`](/documentation/AppKit/NSGlyphStorage/layoutOptions())

Returns the current layout options.

### Modifying the glyph cache

[`insertGlyphs(_:length:forStartingGlyphAt:characterIndex:)`](/documentation/AppKit/NSGlyphStorage/insertGlyphs(_:length:forStartingGlyphAt:characterIndex:))

Inserts the given glyphs into the glyph cache and maps them to the specified characters.

[`setIntAttribute(_:value:forGlyphAt:)`](/documentation/AppKit/NSGlyphStorage/setIntAttribute(_:value:forGlyphAt:))

Sets a custom attribute value for a given glyph.

### Constants

[Layout Options](/documentation/AppKit/layout-options)

Layout options returned as a bit mask by the [`layoutOptions()`](/documentation/AppKit/NSGlyphStorage/layoutOptions()) method.



---

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)