Raxol.UI.Components.Input.TextWrappingCached (Raxol v2.0.1)

View Source

Cached version of text wrapping utilities with performance optimizations.

This module extends the basic TextWrapping functionality with caching for improved performance on repeated operations.

Summary

Functions

Initializes the cache if not already present.

Gets the visual width of text with caching.

Warms up the cache with common strings.

Wraps text by visual width with caching.

Wraps text by word boundaries with caching.

Wraps text based on pixel width and font metrics.

Functions

ensure_cache()

Initializes the cache if not already present.

get_visual_width(text)

Gets the visual width of text with caching.

warmup_cache(strings)

Warms up the cache with common strings.

wrap_line_by_visual_width(text, width)

Wraps text by visual width with caching.

wrap_line_by_word(text, width)

Wraps text by word boundaries with caching.

wrap_to_pixel_width(text, pixel_width, font_manager)

Wraps text based on pixel width and font metrics.