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

# setBidiLevels(_:forGlyphRange:)

Sets the direction of the specified glyphs for bidirectional text.

```
func setBidiLevels(_ levels: UnsafePointer<UInt8>!, forGlyphRange glyphRange: NSRange)
```

## Parameters

`levels`

Values in `levels` can range from 0 to 61 as defined by Unicode Standard Annex #9.

`glyphRange`

The range of glyphs for which the bidirectional text levels are desired.

## 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)