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

View Source

Consolidated text formatting module for the terminal emulator. Combines Core, Attributes, and Colors functionality. Handles advanced text formatting features including double-width/height, text attributes, and color management.

Summary

Types

color()

@type color() ::
  :black
  | :red
  | :green
  | :yellow
  | :blue
  | :magenta
  | :cyan
  | :white
  | {:rgb, non_neg_integer(), non_neg_integer(), non_neg_integer()}
  | {:index, non_neg_integer()}
  | nil

t()

@type t() :: %Raxol.Terminal.ANSI.TextFormatting{
  background: color(),
  blink: boolean(),
  bold: boolean(),
  conceal: boolean(),
  double_height: :none | :top | :bottom,
  double_underline: boolean(),
  double_width: boolean(),
  encircled: boolean(),
  faint: boolean(),
  foreground: color(),
  fraktur: boolean(),
  framed: boolean(),
  hyperlink: String.t() | nil,
  italic: boolean(),
  overlined: boolean(),
  reverse: boolean(),
  strikethrough: boolean(),
  underline: boolean()
}

text_style()

@type text_style() :: %{
  double_width: boolean(),
  double_height: :none | :top | :bottom,
  bold: boolean(),
  faint: boolean(),
  italic: boolean(),
  underline: boolean(),
  blink: boolean(),
  reverse: boolean(),
  conceal: boolean(),
  strikethrough: boolean(),
  fraktur: boolean(),
  double_underline: boolean(),
  framed: boolean(),
  encircled: boolean(),
  overlined: boolean(),
  foreground: color(),
  background: color(),
  hyperlink: String.t() | nil
}

Functions

ansi_code_to_color_name(code)

apply_color(style, type, color)

default_style()

effective_width(style, text)

format_sgr_params(style)

get_hyperlink(style)

get_paired_line_type(style)

needs_paired_line?(style)

new(attrs)

parse_sgr_param(param, style)

reset_background(style)

reset_conceal(style)

reset_double_underline(style)

reset_encircled(style)

reset_faint(style)

reset_foreground(style)

reset_fraktur(style)

reset_framed(style)

reset_strikethrough(style)

set_attribute(emulator, attribute)