Raxol.Terminal.ANSI.CharacterSets (Raxol v2.0.1)

View Source

Consolidated character set management for the terminal emulator. Combines: Handler, StateManager, Translator, and core CharacterSets functionality. Supports G0, G1, G2, G3 character sets and their switching operations.

Summary

Functions

Maps a character set code to module (for backward compatibility).

Designates a character set for a G-set.

Handles a character set control sequence.

Maps an index to a gset name.

Invokes a character set designator.

Creates a new character set state.

Switches the character set for a given G-set. Supports both emulator-based and state-based API.

Translates a character using the current character set state.

Translates a string using the active character set.

Types

charset()

@type charset() ::
  :us_ascii
  | :uk
  | :french
  | :german
  | :swedish
  | :swiss
  | :italian
  | :spanish
  | :portuguese
  | :japanese
  | :korean
  | :latin1
  | :latin2
  | :latin3
  | :latin4
  | :latin5
  | :cyrillic
  | :arabic
  | :greek
  | :hebrew
  | :thai
  | :dec_special_graphics
  | :dec_supplemental_graphics
  | :dec_technical
  | :dec_multinational

codepoint()

@type codepoint() :: non_neg_integer()

Functions

charset_code_to_module(code)

Maps a character set code to module (for backward compatibility).

clear_single_shift(state)

See Raxol.Terminal.ANSI.CharacterSets.StateManager.clear_single_shift/1.

designate_charset(state, gset_index, charset_code)

Designates a character set for a G-set.

get_active(state)

See Raxol.Terminal.ANSI.CharacterSets.StateManager.get_active/1.

get_active_charset(state)

handle_control_sequence(emulator, sequence)

Handles a character set control sequence.

handle_sequence(state, sequence)

See Raxol.Terminal.ANSI.CharacterSets.Handler.handle_sequence/2.

index_to_gset(index)

Maps an index to a gset name.

invoke_designator(state, gset)

Invokes a character set designator.

new()

new_state()

Creates a new character set state.

set_g0(state, charset)

See Raxol.Terminal.ANSI.CharacterSets.StateManager.set_g0/2.

set_g1(state, charset)

See Raxol.Terminal.ANSI.CharacterSets.StateManager.set_g1/2.

set_g2(state, charset)

See Raxol.Terminal.ANSI.CharacterSets.StateManager.set_g2/2.

set_g3(state, charset)

See Raxol.Terminal.ANSI.CharacterSets.StateManager.set_g3/2.

set_gl(state, gset)

See Raxol.Terminal.ANSI.CharacterSets.StateManager.set_gl/2.

set_gr(state, gset)

See Raxol.Terminal.ANSI.CharacterSets.StateManager.set_gr/2.

set_single_shift(state, shift_type)

switch_charset(first_arg, second_arg, third_arg \\ nil)

Switches the character set for a given G-set. Supports both emulator-based and state-based API.

translate_char(codepoint, state)

translate_char(codepoint, active_set, single_shift)

See Raxol.Terminal.ANSI.CharacterSets.Translator.translate_char/3.

translate_character(emulator, char)

Translates a character using the current character set state.

translate_string(string, charset_state)

Translates a string using the active character set.