invalidateLayout(forCharacterRange:isSoft:actualCharacterRange:)
Invalidates the layout information for the glyphs mapped to the given range of characters.
Declaration
func invalidateLayout(forCharacterRange charRange: NSRange, isSoft flag: Bool, actualCharacterRange actualCharRange: NSRangePointer?)Parameters
- charRange:
The character range for which glyphs are invalidated.
- flag:
If True, invalidates internal caches in the layout manager; if False, invalidates layout. See the discussion section.
- actualCharRange:
If not
NULL, on output, the range of characters mapped to the glyphs whose layout information is invalidated. This range can be larger than the range of characters given due to the effect of context on glyphs and layout.
Discussion
This method only invalidates information; it performs no glyph generation or layout. You should rarely need to invoke this method.
For code that needs to work on both OS X v10.5 and previous releases, the following procedures should be used. For OS X v10.4 and before, invalidation should consist of
Calling this method with the
flagset to true, for the range that has actually become invalid.Calling this method with the
flagset to false, for the range (if any) that follows that range, usually extending to the end of the text, that might need to be moved due to relayout of the invalidated range.
As of OS X v10.5, the semantics of the flag parameter are slightly different. Soft layout holes are obsolete in macOS 10.5 and later, so the flag is no longer necessary. If the method is called with flag set to false, then it has the effect of invalidating layout. If it’s called with the flag set to true, then it does not actually invalidate layout; it invalidates a number of internal caches, but otherwise has no effect, and in general is unnecessary.
This method is superseded by invalidateLayout(forCharacterRange:actualCharacterRange:) and will be deprecated in a future release.
See Also
Methods
showCGGlyphs(_:positions:count:font:matrix:attributes:in:)invalidateGlyphs(onLayoutInvalidationForGlyphRange:)textStorage(_:edited:range:changeInLength:invalidatedRange:)insertGlyph(_:atGlyphIndex:characterIndex:)insertGlyphs(_:length:forStartingGlyphAt:characterIndex:)glyph(at:)glyph(at:isValidIndex:)replaceGlyph(at:withGlyph:)getGlyphs(_:range:)getGlyphs(in:glyphs:characterIndexes:glyphInscriptions:elasticBits:)getGlyphs(in:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:)deleteGlyphs(in:)setCharacterIndex(_:forGlyphAt:)intAttribute(_:forGlyphAt:)setIntAttribute(_:value:forGlyphAt:)