---
title: "setHardInvalidation(_:forGlyphRange:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstypesetter/sethardinvalidation(_:forglyphrange:)"
---

# setHardInvalidation(_:forGlyphRange:)

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

## Declaration

```swift
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.

## See Also

### Laying out glyphs

- [layoutGlyphs(in:startingAtGlyphIndex:maxNumberOfLineFragments:nextGlyphIndex:)](appkit/nstypesetter/layoutglyphs(in:startingatglyphindex:maxnumberoflinefragments:nextglyphindex:).md)
- [boundingBox(forControlGlyphAt:for:proposedLineFragment:glyphPosition:characterIndex:)](appkit/nstypesetter/boundingbox(forcontrolglyphat:for:proposedlinefragment:glyphposition:characterindex:).md)
- [getLineFragmentRect(_:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:)](appkit/nstypesetter/getlinefragmentrect(_:usedrect:forparagraphseparatorglyphrange:atproposedorigin:).md)
- [getLineFragmentRect(_:usedRect:remaining:forStartingGlyphAt:proposedRect:lineSpacing:paragraphSpacingBefore:paragraphSpacingAfter:)](appkit/nstypesetter/getlinefragmentrect(_:usedrect:remaining:forstartingglyphat:proposedrect:linespacing:paragraphspacingbefore:paragraphspacingafter:).md)
- [hyphenCharacter(forGlyphAt:)](appkit/nstypesetter/hyphencharacter(forglyphat:).md)
- [hyphenationFactor(forGlyphAt:)](appkit/nstypesetter/hyphenationfactor(forglyphat:).md)
- [shouldBreakLine(byHyphenatingBeforeCharacterAt:)](appkit/nstypesetter/shouldbreakline(byhyphenatingbeforecharacterat:).md)
- [shouldBreakLine(byWordBeforeCharacterAt:)](appkit/nstypesetter/shouldbreakline(bywordbeforecharacterat:).md)
- [willSetLineFragmentRect(_:forGlyphRange:usedRect:baselineOffset:)](appkit/nstypesetter/willsetlinefragmentrect(_:forglyphrange:usedrect:baselineoffset:).md)
