<!--
{
  "availability" : [
    "macOS: 12.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextLayoutManagerDelegate/textLayoutManager(_:renderingAttributesForLink:at:defaultAttributes:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTextLayoutManagerDelegate(im)textLayoutManager:renderingAttributesForLink:atLocation:defaultAttributes:"
  },
  "title" : "textLayoutManager(_:renderingAttributesForLink:at:defaultAttributes:)"
}
-->

# textLayoutManager(_:renderingAttributesForLink:at:defaultAttributes:)

Returns a dictionary of rendering attributes for rendering a link.

```
optional func textLayoutManager(_ textLayoutManager: NSTextLayoutManager, renderingAttributesForLink link: Any, at location: any NSTextLocation, defaultAttributes renderingAttributes: [NSAttributedString.Key : Any] = [:]) -> [NSAttributedString.Key : Any]?
```

## Parameters

`textLayoutManager`

The text layout manager sending the message.

`link`

The link object.

`location`

The document location of the link.

`renderingAttributes`

The default rendering attributes.

## Return Value

A dictionary of rendering attributes for the link, or `nil` to use defaults.

## Discussion

Just as other rendering attributes, specifying
<doc://com.apple.documentation/documentation/Foundation/NSNull> removes the
attribute from the final attributes used for rendering. It has priority over
the general rendering attributes.

The method the framework calls to return a dictionary of attributes for rendering a link attribute name.

---

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)