#svg #graphics #tiny-vg #evg #blend2-d #vector-graphic

bin+lib intvg

lib/tool in Rust to load/save/render tvg file, parse from svg file by usvg

7 releases

0.1.7 Jun 14, 2024
0.1.6 Jun 5, 2024
0.1.5 May 29, 2024
0.1.3 Aug 8, 2023

#76 in Rendering engine

Download history 1/week @ 2024-03-01 2/week @ 2024-03-15 21/week @ 2024-03-29 6/week @ 2024-04-05 127/week @ 2024-05-24 153/week @ 2024-05-31 31/week @ 2024-06-07 139/week @ 2024-06-14

450 downloads per month
Used in inlottie

MIT/Apache

475KB
3K SLoC

Build status codecov Crates.io dependency status License: MIT

Another TinyVG image parser & renderer in Rust

A library/tool to load/save binary .tvg file, rendering to .png file powered by tiny-skia, parsing from .svg file powered by usvg, with least external dependencies, simple and concise Rust code.

TinyVG textual representation (.tvgt) is only for debugging/development purposes which can be easily achieved with #[derive(Debug)] and println!("{:?}, commands) or dbg!(commands) in Rust.

Binding Blend2D rendering engine

Build controlled by feature "b2d".

    (cd 3rdparty && ./layout.sh)    # just run once

    cargo r -F b2d -- <path-to-svg/tvg> [<path-to-tvg/png>]

A built-in Rust binding for Blend2D, simpler than outdated blend2d-rs.

Binding GPAC/EVG 2D rendering engine

Build controlled by feature "evg".

    (cd 3rdparty && ./layout.sh)    # just run once

    cargo r -F evg -- <path-to-svg/tvg> [<path-to-tvg/png>]

Built-in seems the only one Rust binding in public for GPAC/EVG.

A SVG Renderer/Viewer powered by Femtovg

Build controlled by feature "nvg".

    cargo r -F nvg --bin nanovg -- <path-to-svg>

Refer to the SVG example in Femotovg, updated, rewritten and optimized the code, added Drag & Drop support.

Another SVG/TinyVG Viewer based on HTML5/Web 2D Canvas API

Run the following command in the wcnvs sub-crate/project to start the Dioxus dev server:

dx serve --hot-reload

Rendering performance comparison

2D Engine Timing Performance Note
Femtovg: 1.65 ms 606.8 fps max performance
Blend2D: 1.94 ms 515.5 fps float/double
CanvasAPI: 2.00 ms 500.0 fps bad T accuracy?
tiny_skia: 5.10 ms 195.9 fps
GPAC/EVG: 7.96 ms 125.6 fps floating point
GPAC/EVG: 18.07 ms 55.3 fps fixed-point math

Test rendering Ghostscript_Tiger.svg on MacBook Pro with Apple M1 Pro.

Dependencies

~4–22MB
~347K SLoC