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

# characterRange(forGlyphRange:actualGlyphRange:)

Returns the range for the characters in the receiver’s text store that are mapped to the specified glyphs.

```
func characterRange(forGlyphRange glyphRange: NSRange, actualGlyphRange: NSRangePointer?) -> NSRange
```

## Parameters

`glyphRange`

The range of glyphs.

`actualGlyphRange`

On return, the range of all glyphs mapped to the characters in the receiver’s text store. May be `NULL`.

## Return Value

The range for the characters in the receiver’s text store that are mapped to the glyphs in `glyphRange`.

## Discussion

A subclass can override this method to interact with custom glyph storage.

---

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)