Raxol.Terminal.CharacterHandling (Raxol v0.3.0)
View SourceHandles wide character and bidirectional text support for the terminal emulator.
This module provides functions for:
- Determining character width (single, double, or variable width)
- Handling bidirectional text rendering
- Managing character combining
- Supporting Unicode character properties
Summary
Functions
Determines the bidirectional character type. Returns :LTR, :RTL, :NEUTRAL, or :COMBINING.
Determine the display width of a given character code point or string.
Gets the effective width of a string, taking into account wide characters and ignoring combining characters.
Determines if a character is a combining character.
Determines if a character is a wide character (takes up two cells).
Processes a string for bidirectional text rendering. Returns a list of segments with their rendering order.
Splits a string at a given width, respecting wide characters.
Functions
Determines the bidirectional character type. Returns :LTR, :RTL, :NEUTRAL, or :COMBINING.
Determine the display width of a given character code point or string.
@spec get_string_width(String.t()) :: non_neg_integer()
Gets the effective width of a string, taking into account wide characters and ignoring combining characters.
Determines if a character is a combining character.
Determines if a character is a wide character (takes up two cells).
Processes a string for bidirectional text rendering. Returns a list of segments with their rendering order.
@spec split_at_width(String.t(), non_neg_integer()) :: {String.t(), String.t()}
Splits a string at a given width, respecting wide characters.