| Crates.io | termcinema-engine |
| lib.rs | termcinema-engine |
| version | 0.1.0 |
| created_at | 2025-06-10 05:27:51.457615+00 |
| updated_at | 2025-06-10 05:27:51.457615+00 |
| description | 🧠 Core typewriter-style terminal animation engine (SVG renderer) for termcinema |
| homepage | https://github.com/pokeyaro/termcinema |
| repository | https://github.com/pokeyaro/termcinema |
| max_upload_size | |
| id | 1706677 |
| size | 94,582 |
Low-level rendering engine for TermCinema —
turn terminal-style text into animated SVG with fine-grained control over fonts, layout, cursor, and animation timing.
Note: This is the rendering core. For end-user usage, see
termcinema-cli
termcinema-engine provides programmatic APIs to:
🖋 Render multi-line terminal text with typing animations
🎨 Style output with custom fonts, colors, alignment, and layout
🧑🎨 Animate cursors with blinking and movement trails
📜 Support both free-form text and structured REPL/script formats
🧩 Export to SVG strings — suitable for embedding in web or docs
Add to your Cargo.toml:
termcinema-engine = "0.1"
Basic usage example:
use termcinema_engine::{
StyleSpec, LayoutSpec, CursorSpec, ControlSpec,
render_svg_from_input,
};
fn main() {
let svg = render_svg_from_input(
"echo hello", // input text
false, // is script-style? false = typing mode
&StyleSpec::default(),
&LayoutSpec::default(),
&CursorSpec::default(),
&ControlSpec::default(),
);
}
Output is a full <svg>...</svg> string — ready to embed or save to file.
WASM frontends
Static site generators
Code documentation pipelines
Terminal recording tools
Use the structured API for precise layout, animation, and output control:
use termcinema_engine::{
render_typing_from_text,
StyleSpec, LayoutSpec, CursorSpec, ControlSpec,
ContentSpec,
};
fn main() {
let svg = render_typing_from_text(
&ContentSpec { text: "Hello\nWorld!".into() },
&StyleSpec {
font_family: "Fira Code".into(),
font_size: 18,
text_color: Some("#00ffcc".into()),
background_color: Some("#000000".into()),
..Default::default()
},
&LayoutSpec::default(),
&CursorSpec::default(),
&ControlSpec {
frame_delay: 80,
fade_duration: 120,
..Default::default()
},
);
}