Skip to content

Commit

Permalink
refined README.md and bump version to v0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mhfan committed Jun 5, 2024
1 parent 13ce039 commit 778a067
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 49 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[package]
name = "intvg"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
default-run = "intvg"
license = "MIT OR Apache-2.0"
Expand Down
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,49 @@ A library/tool to load/save binary .tvg file, rendering to .png file powered by

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](https://github.com/blend2d/blend2d) rendering engine

Build controlled by feature `"b2d"`.

```bash
(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](https://github.com/Veykril/blend2d-rs).

## Binding [GPAC/EVG](https://github.com/gpac/gpac/tree/master/src/evg) 2D rendering engine

Build controlled by feature `"evg"`.

Built-in seems the only one Rust binding for GPAC/EVG.
```bash
(cd 3rdparty && ./layout.sh) # just run once

## Binding [Blend2D](https://github.com/blend2d/blend2d) rendering engine

Build controlled by feature `"b2d"`.
cargo r -F evg -- <path-to-svg/tvg> [<path-to-tvg/png>]
```

A built-in Rust binding for Blend2D, simpler than outdated [blend2d-rs](https://github.com/Veykril/blend2d-rs).
Built-in seems the only one Rust binding in public for GPAC/EVG.

## A SVG Renderer/Viewer powered by [Femtovg](https://github.com/Femtovg/Femtovg)

Build controlled by feature `"nvg"`.

Refer to the SVG example in Femotovg, updated, rewritten and optimized the code.
```bash
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](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API)

In the sub-crate `wcnvs`.
Run the following command in the [wcnvs](wcnvs/README.md) sub-crate/project to start the Dioxus dev server:

```bash
dx serve --hot-reload
```

- Open the browser to <http://localhost:8080>

## Rendering performance comparison

Expand All @@ -47,4 +69,3 @@ In the sub-crate `wcnvs`.
Test rendering [Ghostscript_Tiger.svg](https://commons.wikimedia.org/wiki/File:Ghostscript_Tiger.svg) on _MacBook Pro_ with _Apple M1 Pro_.

* <https://www.nan.fyi/svg-paths>

42 changes: 2 additions & 40 deletions wcnvs/README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,10 @@

# Development
{% if styling == "Tailwind" %}
1. Install npm: https://docs.npmjs.com/downloading-and-installing-node-js-and-npm
2. Install the tailwind css cli: https://tailwindcss.com/docs/installation
3. Run the following command in the root of the project to start the tailwind CSS compiler:

```bash
npx tailwindcss -i ./input.css -o ./public/tailwind.css --watch
```
{% endif %}
{% if platform == "desktop" %}
Run the following command in the root of the project to start the Dioxus dev server:

```bash
dx serve --hot-reload --platform desktop
```
{% else %}
{% if platform == "TUI" %}
Run the following command in the root of the project to start the Dioxus dev server:

```bash
dx serve --hot-reload --platform desktop
```
{% else %}
{% if platform == "web" %}
Run the following command in the root of the project to start the Dioxus dev server:

```bash
dx serve --hot-reload
```

- Open the browser to http://localhost:8080
{% else %}
{% if platform == "Fullstack" %}
Launch the Dioxus Fullstack app:

```bash
dx build --features web --release
cargo run --features ssr --release
```
{% else %}
Launch the Dioxus app:

```bash
cargo run
```
{% endif %}
{% endif %}
- Open the browser to <http://localhost:8080>

0 comments on commit 778a067

Please sign in to comment.