Instance Method

invalidateGlyphs(forCharacterRange:changeInLength:actualCharacterRange:)

Invalidates the cached glyphs for the characters in the given character range, adjusts the character indices of all the subsequent glyphs by the change in length, and invalidates the new character range.

Declaration

func invalidateGlyphs(forCharacterRange charRange: NSRange, changeInLength delta: Int, actualCharacterRange actualCharRange: NSRangePointer?)

Parameters

charRange

The range of characters for which to invalidate glyphs.

lengthChange

The number of characters added or removed.

actualCharRange

If not NULL, on output, the actual range invalidated after any necessary expansion. 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 glyph information and performs no glyph generation or layout. Because invalidating glyphs also invalidates layout, after invoking this method you should also invoke invalidateLayout(forCharacterRange:actualCharacterRange:), passing charRange as the first argument.

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.

See Also

Invalidating Glyphs and Layout

func invalidateDisplay(forCharacterRange: NSRange)

Invalidates display for the given character range.

func invalidateDisplay(forGlyphRange: NSRange)

Marks the glyphs in the given glyph range as needing display, as well as the appropriate regions of the NSTextView objects that display those glyphs (using the NSView method setNeedsDisplay(_:)).

func invalidateLayout(forCharacterRange: NSRange, actualCharacterRange: NSRangePointer?)

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