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

# setNotShownAttribute(_:forGlyphAt:)

Sets the visibility of the glyph at the specified index.

```
func setNotShownAttribute(_ flag: Bool, forGlyphAt glyphIndex: Int)
```

## Parameters

`flag`

If <doc://com.apple.documentation/documentation/Swift/true>, the glyph is not shown; if <doc://com.apple.documentation/documentation/Swift/false>, it is shown.

`glyphIndex`

Index of the glyph whose attribute is set.

## Discussion

The typesetter decides which glyphs are not shown and sets this attribute in the layout manager to ensure that those glyphs are not displayed. For example, a tab or newline character doesn’t leave any marks; it just indicates where following glyphs are laid out.

Raises an `NSRangeException` if `glyphIndex` is out of bounds.

This method is used by the layout mechanism and should be invoked only during typesetting, in almost all cases only by the typesetter. For example, a custom typesetter might invoke it.

---

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)