Skip to main content

TextRunCache Class

Definition​

Assembly:Avalonia.Base
Package:Avalonia

Caches shaped text runs and bidi processing results to avoid redundant shaping when only the paragraph width constraint changes (e.g., between Measure and Arrange).

public class TextRunCache

Inheritance: object -> TextRunCache

Implements: IDisposable

Remarks​

Uses an inline single-entry store for the common case of a single paragraph, and only promotes to a dictionary when multiple entries are added.

Constructors​

NameDescription
TextRunCacheNo summary available.

TextRunCache Constructor​

public TextRunCache()

Methods​

NameDescription
DisposeNo summary available.
InvalidateInvalidates all cached entries and disposes their shaped buffers.
InvalidateFromInvalidates all cached entries at or after the specified text source index.

Dispose Method​

public void Dispose()

Invalidate Method​

Invalidates all cached entries and disposes their shaped buffers.

public void Invalidate()

InvalidateFrom Method​

Invalidates all cached entries at or after the specified text source index.

public void InvalidateFrom(int textSourceIndex)

Parameters​

textSourceIndex int

The text source index from which to invalidate.