<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSLayoutManager/ensureGlyphs(forGlyphRange:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLayoutManager(im)ensureGlyphsForGlyphRange:"
  },
  "title" : "ensureGlyphs(forGlyphRange:)"
}
-->

# ensureGlyphs(forGlyphRange:)

Forces the layout manager to generate glyphs for the specified glyph range if it hasn’t already.

```
func ensureGlyphs(forGlyphRange glyphRange: NSRange)
```

## Parameters

`glyphRange`

The glyph range for which glyphs are generated.

## Discussion

The layout manager reserves the right to perform glyph generation for larger ranges. If noncontiguous layout is disabled, then the affected range is always effectively extended to start at the beginning of the text.

---

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)