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

# glyphRange(forCharacterRange:actualCharacterRange:)

Returns the range of glyphs that the specified range of characters generates.

```
func glyphRange(forCharacterRange charRange: NSRange, actualCharacterRange actualCharRange: NSRangePointer?) -> NSRange
```

## Parameters

`charRange`

The character range for which to return the generated glyph range.

`actualCharRange`

If not `NULL`, on output, points to the actual range of characters that fully define the glyph range returned. This range may be identical to or slightly larger than the requested character range. For example, if the text storage contains the characters “`O`” and `"¨"`, and the glyph store contains the single precomposed glyph “¨`Ö`”, and if `charRange` encloses only the first or second character, then `actualCharRange` is set to enclose both characters.

## Return Value

The range of glyphs generated by `charRange`.

## Discussion

If the length of `charRange` is `0`, the resulting glyph range is a zero-length range just after the glyph(s) corresponding to the preceding character, and `actualCharRange` will also be zero-length. If `charRange` extends beyond the text length, the method truncates the result to the number of glyphs in the text.

If noncontiguous layout is not enabled, this method forces the generation of glyphs for all characters up to and including the end of the specified range.

---

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)