[package]
name = "rpic-render"
description = "Raster (PNG) and PDF rendering for rpic, by rasterizing/converting its SVG output (pure Rust: resvg/tiny-skia, svg2pdf)."
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
keywords = ["svg", "png", "pdf", "render", "rasterize"]
categories = ["graphics", "rendering"]

[features]
# Both on by default for CLI/binding builds. The wasm math build depends on
# this crate with `default-features = false, features = ["math"]` to get the
# RaTeX renderer without the rasterizer weight.
default = ["raster", "math"]
# PNG/PDF backends (resvg/tiny-skia, svg2pdf).
raster = ["dep:resvg", "dep:svg2pdf"]
# The `texlabels` math renderer (RaTeX).
math = [
    "dep:rpic-core",
    "dep:ratex-parser",
    "dep:ratex-layout",
    "dep:ratex-svg",
    "dep:ratex-types",
]

[dependencies]
resvg = { version = "0.47.0", optional = true }
# svg2pdf 0.13 (newest as of 2026-07; upstream quiet since 2025-03) pins its
# own resvg/usvg 0.45, so the lock carries both 0.45 and 0.47 pipelines
# (kurbo/png/gif duplicated too). Deliberate: we keep resvg newest-stable
# rather than downgrading to match. Revisit at each release — a svg2pdf
# release on resvg 0.47+ collapses the tree (tracked in #213).
svg2pdf = { version = "0.13.0", optional = true }
rpic-core = { version = "0.10.0", path = "../core", optional = true }
ratex-parser = { version = "0.1.12", optional = true }
ratex-layout = { version = "0.1.12", optional = true }
ratex-svg = { version = "0.1.12", features = ["standalone", "embed-fonts"], optional = true }
ratex-types = { version = "0.1.12", optional = true }
