Instance Method

textStorage:edited:range:changeInLength:invalidatedRange:

Invalidates glyph and layout information for a portion of the text in the given text storage object.

Declaration

- (void)textStorage:(NSTextStorage *)str edited:(NSTextStorageEditedOptions)editedMask range:(NSRange)newCharRange changeInLength:(NSInteger)delta invalidatedRange:(NSRange)invalidatedCharRange;

Parameters

aTextStorage

The text storage whose information is invalidated.

mask

Specifies the nature of the changes. Its value is made by combining with the C bitwise OR operator the constants described in “Change notifications” in NSTextStorage (NSTextStorageEditedAttributes and NSTextStorageEditedCharacters).

newCharRange

Indicates the extent of characters resulting from the edits.

delta

If the NSTextStorageEditedCharacters bit of mask is set, gives the number of characters added to or removed from the original range (otherwise its value is irrelevant).

invalidatedCharRange

Represents the range of characters affected after attributes have been fixed. Is either equal to newCharRange or larger. For example, deleting a paragraph separator character invalidates the layout information for all characters in the paragraphs that precede and follow the separator.

Discussion

This message is sent from the NSTextStorageobject’s processEditing method to indicate that its characters or attributes have changed. This method invalidates glyphs and layout for the affected characters.

For example, after replacing “The” with “Several” to produce the string “Several files couldn’t be saved”, newCharRange is {0, 7} and delta is 4. The receiver uses this information to update its character-to-glyph mapping and to update the selection range based on the change.

The textStorage:edited:range:changeInLength:invalidatedRange: messages are sent in a series to each NSLayoutManager object associated with the text storage object, so the layout managers receiving them shouldn’t edit aTextStorage while this method is executing. If one of them does, the newCharRange, delta, and invalidatedCharRange arguments are incorrect for all following layout managers that receive the message.

See Also

Methods

- showCGGlyphs:positions:count:font:matrix:attributes:inContext:

Renders the glyphs at the specified positions, using the specified attributes.

Deprecated
- invalidateGlyphsOnLayoutInvalidationForGlyphRange:

Specifies explicitly when portions of the glyph stream depend on layout.

Deprecated
- invalidateLayoutForCharacterRange:isSoft:actualCharacterRange:

Invalidates the layout information for the glyphs mapped to the given range of characters.

Deprecated
- insertGlyph:atGlyphIndex:characterIndex:

Inserts a single glyph into the glyph stream at the given index and maps it to the character at the given character index.

Deprecated
- insertGlyphs:length:forStartingGlyphAtIndex:characterIndex:

Inserts the given glyphs into the glyph cache at the given index and maps them to characters beginning at the given character index.

Deprecated
- glyphAtIndex:

Returns the glyph at the specified index.

Deprecated
- glyphAtIndex:isValidIndex:

Returns the glyph at a specified index, and optionally returns a flag indicating whether the requested index is valid.

Deprecated
- replaceGlyphAtIndex:withGlyph:

Replaces the glyph at the given index with a new glyph.

Deprecated
- getGlyphs:range:

Fills the passed-in buffer with a sequence of glyphs.

Deprecated
- getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:

Returns the glyphs and information needed to perform layout for the given glyph range.

Deprecated
- getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:bidiLevels:

Returns the glyphs and information needed to perform layout for the given glyph range.

Deprecated
- deleteGlyphsInRange:

Deletes the glyphs in the given range from the receiver’s glyph store.

Deprecated
- setCharacterIndex:forGlyphAtIndex:

Sets the index of the character corresponding to the glyph at the given glyph index.

Deprecated
- intAttribute:forGlyphAtIndex:

Returns the value of the attribute identified by the given attribute tag for the glyph at the given index.

Deprecated
- setIntAttribute:value:forGlyphAtIndex:

Sets a custom attribute value for a given glyph.

Deprecated
- setLocations:startingGlyphIndexes:count:forGlyphRange:

Sets locations for many glyph ranges at once.

Deprecated
- rectArrayForCharacterRange:withinSelectedCharacterRange:inTextContainer:rectCount:

Returns an array of rectangles and, by reference, the number of such rectangles, that define the region in the given container enclosing the given character range.

Deprecated
- rectArrayForGlyphRange:withinSelectedGlyphRange:inTextContainer:rectCount:

Returns an array of rectangles and, by reference, the number of such rectangles, that define the region in the given container enclosing the given glyph range.

Deprecated
- substituteFontForFont:

Replaces the specified font with a suitable screen font if one is available.

Deprecated