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

# NSTextLayoutOrientationProvider

A set of methods that define the orientation of text for an object.

```
protocol NSTextLayoutOrientationProvider
```

## Overview

In macOS, the [`NSTextContainer`](/documentation/AppKit/NSTextContainer) and [`NSTextView`](/documentation/AppKit/NSTextView) classes adopt this protocol; in iOS, only the [`NSTextContainer`](/documentation/AppKit/NSTextContainer) class implements it. An [`NSTextContainer`](/documentation/AppKit/NSTextContainer) object returns the value from its associated text view when present; otherwise, it returns [`NSLayoutManager.TextLayoutOrientation.horizontal`](/documentation/AppKit/NSLayoutManager/TextLayoutOrientation/horizontal) by default. If you define a custom [`NSTextContainer`](/documentation/AppKit/NSTextContainer) object, you can override this method and return [`NSLayoutManager.TextLayoutOrientation.vertical`](/documentation/AppKit/NSLayoutManager/TextLayoutOrientation/vertical) to support laying out text vertically.

## Topics

### Getting layout orientation

[`layoutOrientation`](/documentation/AppKit/NSTextLayoutOrientationProvider/layoutOrientation)

The default layout orientation.

[`NSLayoutManager.TextLayoutOrientation`](/documentation/AppKit/NSLayoutManager/TextLayoutOrientation)

Constants that describe the text layout orientation.



---

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)