Skip to content

Releases: goyox86/thorvg-rs

thorvg 0.4.2

15 Jun 21:04

Choose a tag to compare

Documentation-only release. No code, API, or behavior change — a patch
bump so the revised docs render on docs.rs.

Documentation

  • Reviewed every public item against the ThorVG C API (thorvg_capi.h
    contracts and tvgCapi.cpp behavior) and corrected inaccuracies in
    error conditions, parameter units/ranges, ownership/lifetime claims,
    defaults, and experimental status. Notable fixes: TextMetrics::advance
    is the vertical line advance (not a horizontal run advance); the Scene
    drop-shadow default direction claim was removed; Shape stroke defaults,
    the empty-dash-slice error, and circular trim-path wrapping are now
    documented.
  • Normalized the rustdoc to one style — terse summaries, # Errors /
    # Safety / # Panics sections, intra-doc links, sharpened safety and
    reliability contracts, and a per-module link to the upstream
    C API docs.

thorvg 0.4.1

15 Jun 20:03
49237f4

Choose a tag to compare

Portability and documentation fixes. No API change — a patch bump.

Fixed

  • Windows (MSVC) build. Path-command decoding no longer depends on
    bindgen's enum repr: the TVG_PATH_COMMAND_* constants are c_uint on
    most targets but c_int on MSVC, which broke the match (E0308).
  • Three broken rustdoc intra-doc links (Thorvg::load_font,
    BorrowedPaint, BorrowedPaint::paint_type).

Changed

  • Depends on thorvg-sys 0.2.1, which carries the MSVC and
    system-library (pkg-config) build fixes.

thorvg 0.4.0

15 Jun 17:14

Choose a tag to compare

Tracks ThorVG 1.0.6 (via thorvg-sys 0.2). Picks up the upstream
API changes that affect the safe surface.

Changed (breaking)

  • Depends on thorvg-sys 0.2 (bundling ThorVG 1.0.6).

Added

  • LottieAnimation::set_audio_resolver / clear_audio_resolver and the
    AudioInfo borrowed view — safe wrappers over ThorVG 1.0.6's new
    Lottie audio-resolver callback, for synchronizing external audio
    playback with the animation timeline. The closure is heap-stored and
    unregistered on drop (same ownership model as the asset resolver).
    Experimental upstream.
  • EngineOption::Aliased — re-introduced upstream in ThorVG 1.0.6
    (disables anti-aliased rendering). Marked experimental by upstream.
    The EngineOption enum is #[non_exhaustive], so this is additive.

Removed (breaking)

  • LottieAnimation::assign — the underlying experimental
    tvg_lottie_animation_assign C API was removed in ThorVG 1.0.6.

thorvg-sys 0.2.1

15 Jun 20:03
49237f4

Choose a tag to compare

Build-system and portability fixes; still bundles ThorVG 1.0.6. No
API change — a patch bump.

Fixed

  • System (non-vendored) build now finds ThorVG 1.x. link_system
    probed the unversioned thorvg pkg-config module, but ThorVG 1.x
    installs thorvg-1 (meson filebase: 'thorvg-' + vmaj). Probe
    thorvg-1 first, falling back to thorvg for distros that ship the
    unversioned name.
  • MSVC vendored build. Define NOMINMAX — the Windows SDK's
    min/max macros mangled tvgMath.h's Point min(...) / max(...)
    declarations (C2059) — and pass /EHsc for the standard C++ exception
    model.
  • Static linkage on MSVC. Define TVG_STATIC: the vendored library
    is linked as a static archive, but without it the C API expanded to
    __declspec(dllimport) and MSVC rejected the definitions (C2491).

thorvg-sys 0.2.0+thorvg-1.0.6

15 Jun 17:14

Choose a tag to compare

Bundles ThorVG 1.0.6. The minor bump reflects a breaking change to
the generated FFI surface (a removed C API symbol).

Changed

  • Bumped vendored ThorVG to 1.0.6. The seven bare-metal patches that
    sat on v1.0.5 were rebased unchanged onto v1.0.6.

Added

  • tvg_lottie_animation_set_audio_resolver, the Tvg_Audio_Resolver
    callback type, and the Tvg_Audio_Info struct — new in ThorVG 1.0.6
    for synchronizing external audio playback with the Lottie timeline.
  • TVG_ENGINE_OPTION_ALIASED — re-introduced upstream (disables
    anti-aliased rendering); it had been dropped in 1.0.5.

Removed

  • tvg_lottie_animation_assign — removed upstream in ThorVG 1.0.6.
    Breaking for any code that called it through the raw bindings.

thorvg 0.3.0

13 Jun 18:08

Choose a tag to compare

A large API-hardening and ergonomics release. The headline themes are
type-safety (enums and parameter structs replacing primitives), a
shared color module, sealed traits, lifetime-correct borrowed views,
and a sweep of memory-safety fixes around FFI ownership.

Changed (breaking)

  • Colors are now typed. Text::set_color / set_outline take
    Rgb; Shape fill/stroke and gradient ColorStop take Rgba.
    Raw u8 channel arguments are gone. Rgb/Rgba live in a shared
    color module, which now also hosts ColorSpace.
  • EngineOption is a plain enum (None / Default / SmartRender)
    matching the C++ engine's exact-equality semantics, instead of a
    bitflags newtype.
  • Shape paint order is a PaintOrder enum (FillThenStroke /
    StrokeThenFill) instead of a bool.
  • Shape primitives take parameter structsRect and Circle
    (with builders and Default) replace long positional argument lists.
  • Scene effects take parameter structsGaussianBlur,
    DropShadow, Tint, and Tritone (builders + Default); blur
    direction and border are now enums rather than ints. Effect methods
    were renamed for consistency.
  • Factory methods return Result across paint/scene/picture/text/
    animation/saver/accessor/gradient, instead of panicking or returning
    bare handles on allocation failure.
  • set_mask / set_clip consume the paint by value, modelling the
    ownership transfer to the C engine (prevents double-free / leaks).
  • Canvas::push and Scene::push renamed to add for C API parity.
  • Picture::load_data takes a typed MimeType enum instead of a
    string.
  • Font-loading API moved from Text to Thorvg (it is engine-global
    state, not per-text).
  • Thorvg::init signature is gated on the threads feature.
  • Paint and Canvas are now sealed traits — they cannot be
    implemented downstream.
  • from_raw conversions are exhaustive for PaintType and
    MaskMethod, and Shape enums (FillRule, StrokeCap, StrokeJoin)
    are exhaustive.

Added

  • Typed Path / PathCommand / Segment model; Shape::path returns
    it and Shape::append_path closes the round-trip. Segments now
    implements size_hint.
  • Text::text getter (C parity).
  • Shape::set_stroke_radial_gradient (C parity).
  • Chainable Matrix transform combinators.
  • Point::new plus rounded-out ergonomics and enum-variant docs.
  • GlCanvas / WgCanvas GPU target builders for API parity (the
    vendored build still strips the GPU engine).
  • Safe, closure-based Picture::set_asset_resolver; BorrowedAccessor
    and BorrowedPaint are passed into for_each visitors.
  • impl From<NulError> for Error, so CString construction works with
    ?.
  • Gradient kinds are enumerated in PaintType.

Fixed

  • Memory leaks in Paint::set_clip / set_mask and a leaked gradient
    handle in Shape (now exposed as a BorrowedGradient view). Leaks are
    memory-safe; the related double-free is listed under Security below.
  • Paint's mask getter called the wrong C API; replaced with the correct
    one.
  • Animation::picture and Picture::get_paint now return stable borrows
    (&Picture / BorrowedPaint) instead of a rebuilt wrapper / raw
    handle — clearer ownership. (Neither was unsound in prior releases.)
  • Hardened the newly safe, closure-based Picture::set_asset_resolver
    (new in this release, see Added) so its trampoline pointer stays stable
    across moves of the picture.

Security

Several FFI-ownership and bounds bugs that were unsound — reachable
from safe code without unsafe
— are fixed in this release. All of
them affect published versions ≤ 0.2.0 (the APIs date back to the
initial release) and are fixed in 0.3.0; users should upgrade.
0.1.0 and 0.1.1 were already yanked.

  • Use-after-free in Saver::save_animation.
  • Dangling input buffersPicture::load_data / Picture::load_raw
    and Text::load_font_data did not tie the borrowed slice's lifetime to
    the consuming object, so the engine could read freed memory after the
    slice was dropped. The buffer lifetime is now enforced by the type
    system.
  • Out-of-bounds read in Picture::load_raw — the pixel-buffer length
    was not validated against the declared width × height; now
    bounds-checked.
  • Out-of-bounds write in SwCanvas::set_target — the target buffer
    size computation could overflow and accept an undersized buffer; now
    overflow-checked.
  • Double-free via Paint::set_clip / set_mask — these took the
    clipper/mask by reference while the engine took ownership, so the Rust
    wrapper and the engine could both free it. They now consume the paint
    by value.
  • Undefined behaviour on panic across FFI — a panic in a user closure
    passed to Accessor::for_each unwound through an extern "C"
    trampoline (UB). Such closures are now wrapped in catch_unwind under
    std; the no_std panic policy is documented.

Removed

  • The unused, unsafe Accessor::set raw-FFI escape hatch.

Deprecated

  • Gradient::get_transform — renamed to transform for consistency
    with Paint::transform.

thorvg-sys 0.1.0+thorvg-1.0.5

13 Jun 18:08

Choose a tag to compare

First release under the crate's own versioning. Supersedes the yanked
1.0.0 / 1.0.1 / 1.0.5
, which mirrored the upstream ThorVG version
number 1:1 — a scheme abandoned because it left no room to publish
sys-crate-only changes (build system, bare-metal support) while upstream
stayed at 1.0.5. Bundles ThorVG 1.0.5.

Changed

  • Versioning scheme — the crate version is now independent of
    upstream; the bundled ThorVG release is carried as +thorvg-X.Y.Z
    build metadata. The previous upstream-mirroring 1.0.x releases are
    yanked.

Build system

  • Replaced the meson + ninja build with the cc crate — ThorVG is
    compiled from source via Cargo's configured (cross-)compiler; no meson
    or ninja required.
  • Feature-gated loaders and capabilitieslottie, svg, png,
    fonts, expressions, threads, file-io Cargo features select
    which ThorVG components compile (all enabled by default; embedded users
    disable defaults and pick what they need).
  • bindgen now passes an explicit --target= to libclang on host builds.

Bare-metal support (target_os = "none")

  • Toolchain-agnostic cross-compilation pipeline, split into bare-metal
    vs. SDK-runtime policy.
  • Vendors picolibc (submodule pinned to 1.8.11) as the libc on
    bare-metal: compile-time picolibc.h configuration plus a compile-only
    validation phase in build.rs.
  • Per-concern runtime stubs welded to picolibc declarations with weak
    linkage; bridges newlib's __errno() to picolibc's plain errno;
    stubs _on_exit.
  • RISC-V canonical-multilib selection; expressions enabled on
    bare-metal ESP32-C6.

Vendored ThorVG patches

  • Local shims layered on ThorVG 1.0.5 to support bare-metal builds:
    a bsearch shim, a Lottie-loader shim extension, and runtime-stub
    welding across tvgLock.h, tvgInitializer.cpp, tvgRender.cpp,
    tvgSwRenderer.cpp, and tvgSwMemPool.cpp.