<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextViewportLayoutControllerDelegate/textViewportLayoutController(_:configureRenderingSurfaceFor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextViewportLayoutControllerDelegate(im)textViewportLayoutController:configureRenderingSurfaceForTextLayoutFragment:"
  },
  "title" : "textViewportLayoutController(_:configureRenderingSurfaceFor:)"
}
-->

# textViewportLayoutController(_:configureRenderingSurfaceFor:)

The method the framework calls when the layout controller lays out a text layout fragment in the UI.

```
func textViewportLayoutController(_ textViewportLayoutController: NSTextViewportLayoutController, configureRenderingSurfaceFor textLayoutFragment: NSTextLayoutFragment)
```

## Parameters

`textViewportLayoutController`

The `NSTextViewportLayoutController` associated with this text layout fragment.

`textLayoutFragment`

An `NSTextLayoutFragment`.

## Discussion

The delegate presents the text layout fragment in the UI, for example, in a sublayer or a subview. Layout information such as `viewportBounds` on `textViewportLayoutController` isn’t up to date at the point of this call.

---

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)