Expand description
Raster (PNG) and PDF backends for rpic.
These consume the SVG produced by rpic-core and convert it with pure-Rust
libraries (no system dependencies), keeping rpic-core itself
dependency-free and WASM-friendly.
- PNG: parse the SVG with
usvg, rasterize withresvg/tiny-skia. - PDF: parse with svg2pdf’s
usvg, convert withsvg2pdf.
Text is rendered with a bundled font (the Go font, BSD-3-Clause)
registered as every default family, so attached labels rasterize identically
on any machine — no dependency on which fonts happen to be installed. See
fonts/LICENSE.
Modules§
- math
- RaTeX-backed math renderer for the rpic
texlabelsextension.
Structs§
- Raster
Limits - Limits applied before allocating a PNG raster surface.
Constants§
- DEFAULT_
MAX_ RASTER_ DIMENSION - Default maximum PNG raster dimension, in pixels, for either axis.
- DEFAULT_
MAX_ RASTER_ PIXELS - Default maximum PNG raster area, in pixels.
Functions§
- to_pdf
- Convert an SVG string to PDF bytes.
- to_png
- to_
png_ with_ limits - Rasterize an SVG string to PNG bytes with explicit raster allocation limits.