Expand description
Convert ANSI/SGR text into egui text representations.
The primary output is egui::text::LayoutJob, because ANSI text is a
single logical string with style changes inside it.
use egui_sgr::{ansi_to_layout_job, EguiAnsiTheme};
let theme = EguiAnsiTheme::default();
let job = ansi_to_layout_job("\x1b[31mred\x1b[0m default", &theme);
assert_eq!(job.text, "red default");Structs§
- Ansi
Span - A visible run of text with one ANSI style.
- Ansi
Span Buffer - Accumulates streamed ANSI spans and can render the full buffer to egui.
- Ansi
Stream Parser - Stateful streaming ANSI parser.
- Ansi
Style - Complete style state for an ANSI span.
- Egui
Ansi Theme - Theme used when converting ANSI spans into egui text formats.
Enums§
- Ansi
Color - ANSI color representation before it is mapped into an egui color.
- Ansi
Intensity - ANSI text intensity.
- Underline
Style - ANSI underline style.
Functions§
- ansi_
bytes_ to_ layout_ job - Converts bytes with ANSI escapes directly to an egui layout job.
- ansi_
bytes_ to_ spans - Converts bytes into ANSI spans.
- ansi_
to_ layout_ job - Converts a UTF-8 string with ANSI escapes directly to an egui layout job.
- ansi_
to_ spans - Converts a UTF-8 string into ANSI spans.
- example_
usage - Small compile-checked usage sample used by examples and documentation.
- spans_
to_ layout_ job - Converts ANSI spans to an egui layout job.