Skip to content

v0.2.0

Choose a tag to compare

@nazrdogan nazrdogan released this 03 Oct 09:31
· 24 commits to main since this release
e6b615f

Performance

  • Each layer is drawn as a single filled element instead of a full-canvas
    rect clipped by a clipPath; all dots share one <path>.
    PNG is 2–3x faster, and SVG output is about half the size.
  • System fonts load once per process, and only for SVGs containing text.
    Small PDFs are about 13x faster.
  • SvgRenderer borrows options instead of cloning them, and the logo is
    embedded once instead of twice.

Fixes

  • Oversized margin no longer panics. The builder returns CanvasTooSmall.
  • Color::from_hex no longer panics on non-ASCII input.
  • PNG/WebP keep transparent backgrounds; semi-transparent colors are no
    longer darkened (premultiplied alpha).
  • Border text, style and image src are XML-escaped.
  • The logo area uses the image's real aspect ratio.
  • Border decorations are emitted in a deterministic order.
  • PNG output now renders border text (fonts were previously only loaded for PDF).

Features

  • QROptions::mode is now honored. An explicit mode encodes all data in
    that mode and errors on unsupported characters.
  • type_number > 40 returns InvalidVersion.
  • The png, jpeg and webp features now actually gate the encoders.
  • New default feature pdf (PdfRenderer, OutputFormat::Pdf).

Breaking changes

  • QRDot::draw, QRCornerSquare::draw and QRCornerDot::draw return a
    <path> element instead of <circle>/<rect>. New push_path methods
    append raw path data.
  • SvgRenderer has a lifetime parameter. SvgRenderer::from_ref borrows
    the options; SvgRenderer::new still takes owned options.
  • PdfRenderer requires the pdf feature (enabled by default).
  • SVG markup changed (no clipPaths; coordinates rounded to 3 decimals).
    Rendered output is visually identical.

Dependencies

  • resvg 0.45 and svg2pdf 0.13 now share one usvg/fontdb.
  • Removed the unused tiny-skia, serde_json and proptest; lopdf is
    now a dev-dependency.

Full changelog: 0ecaffb...v0.2.0