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

# setHardInvalidation(_:forGlyphRange:)

Sets whether to force the layout manager to invalidate the specified portion of the glyph cache when invalidating layout.

```
func setHardInvalidation(_ flag: Bool, forGlyphRange glyphRange: NSRange)
```

## Parameters

`flag`

<doc://com.apple.documentation/documentation/Swift/true> if the layout manager should invalidate the specified portion of the glyph cache, <doc://com.apple.documentation/documentation/Swift/false> otherwise.

`glyphRange`

The range of glyphs in the cache to be marked for hard invalidation.

---

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)