Expand description
Terminal Cinematic Renderer — render styled terminal sessions as SVG animations.
This crate provides the core logic for formatting, styling, and rendering terminal-like output (shell sessions, REPLs, CLI tools) into SVG or other formats.
It exposes configurable options for font, color, layout, cursor behavior, and animation control.
§Key Features
- Built-in theme presets (
ThemePreset) - Style and layout config (
StyleSpec,LayoutSpec, etc.) - Typing animations with customizable speed and fade (
ControlSpec) - Font resolution (embedded + system fonts)
- Text parsing for shell/REPL-style sessions
For CLI integration, see termcinema-cli. For advanced control, access core APIs directly.
Powered by Rust 🦀 + SVG ✨
Structs§
- Command
Group - Grouped command entry with associated I/O segments.
- Content
Spec - Content specification: raw text input, unstructured.
- Control
Spec - Controls playback behavior of the SVG animation.
- Cursor
Spec - Cursor style specification used in rendering and theming.
- Layout
Spec - Layout configuration for the rendering canvas.
- Style
Spec - Visual style configuration for font and color settings.
- Theme
Preset - Represents a full visual theme preset.
Enums§
- Text
Align - Horizontal text alignment options.
- Theme
Error - Errors that can occur during theme resolution.
- Vertical
Align - Vertical alignment options for block positioning.
Constants§
- DEFAULT_
CONTROL_ FADE_ DURATION - Duration of character fade-in, in milliseconds.
- DEFAULT_
CONTROL_ FRAME_ DELAY - Delay between each character during typing, in milliseconds.
- DEFAULT_
CONTROL_ START_ DELAY - Delay before animation starts, in milliseconds.
- DEFAULT_
CURSOR_ BLINK - Whether cursor blinking is enabled by default.
- DEFAULT_
CURSOR_ BLINK_ MS - Default blinking interval in milliseconds.
- DEFAULT_
CURSOR_ CHAR - Default cursor character (e.g. vertical bar).
- DEFAULT_
CURSOR_ OFFSET_ X - Horizontal cursor offset in pixels.
- DEFAULT_
CURSOR_ OPACITY - Cursor opacity from 0.0 (transparent) to 1.0 (fully visible).
- DEFAULT_
STYLE_ BACKGROUND_ COLOR - Default background color in hexadecimal (e.g. black).
- DEFAULT_
STYLE_ FONT_ FAMILY - Default font family name (used in CSS
font-family). - DEFAULT_
STYLE_ FONT_ SIZE - Default font size in pixels.
- DEFAULT_
STYLE_ TEXT_ COLOR - Default text color in hexadecimal (e.g. white).
Functions§
- all_
presets - Returns a list of all built-in theme presets.
- get_
theme_ by_ name - Looks up a theme by its display name (case-insensitive).
- list_
builtin_ system_ fonts - Returns a whitelist of system fonts considered monospace-safe.
- list_
embeddable_ font_ families - Returns a list of all embeddable CSS
font-familynames. - recommended_
fonts_ for_ current_ os - Suggest recommended fonts based on the current operating system.
- render_
repl_ from_ script - Render a REPL-style SVG from shell script input.
- render_
svg_ from_ input - Render a full SVG output based on raw text input and display mode.
- render_
typing_ from_ text - Render a typing-style SVG from raw text.
- resolve_
embedded_ font - Resolve a font by its CSS
font-familyname. - resolve_
theme - Resolves a theme by name (case-insensitive, underscores allowed).