Skip to content

1.1.0

Choose a tag to compare

@ronison ronison released this 16 Nov 14:09
· 11 commits to main since this release

Bars4J 1.1.0

Added

  • Inline HTML/SVG snippet for the Node.js port (toHtml): the @bars4j/core package now offers the same entry points as the Java library — BarcodeGenerator.of(id).toHtml(text) for the natural size and toHtml(text, displayWidth, displayHeight) for an explicit display size. The snippet has no XML prologue, carries a viewBox (scales with its container), role="img" and an escaped aria-label, and its drawing markup is byte-for-byte identical to the golden-validated toSvg output. Verified against the Java implementation for all 24 registered formats, at natural and explicit display size (48/48 identical).
  • AGENTS.md integration guide for AI coding agents (format ids, output API, RenderSpec bounds, exceptions, JPMS notes, pitfalls).
  • Shared org.bars4j.encode.matrix.ecc layer (GfField + ReedSolomonCoder) unifying the GF(2^m) field and Reed-Solomon arithmetic across QR Code, Data Matrix and Aztec (~−214 duplicated lines; both GF(256) polynomials now documented and cached via GfField.of).
  • EAN5.svg added to the demo samples.

Changed

  • Linear renderers refactored behind a shared BarRect + LinearPainters pipeline (renderers now only decide geometry; raster/SVG painting is centralized), with a shared SvgDocument assembly for the standalone SVG output. Pixel-exact ink coverage preserved for all 20 linear formats.
  • Node 1D renderers mirror the Java BarRect pipeline (one absolute SVG subpath per element, inks separated per colour).

Fixed

  • PostNet SVG bars were drawn below the 12 px canvas (y=20..28); restored the bottom-aligned rule at the baseline.
  • ITF-14 wide ratio was hardcoded to 2.0, ignoring the format's registered 2.5 — the canvas shrank from 155 to 126 px; the ratio is now read from the spec.
  • module-info.java now declares requires java.logging;, restoring the modular build.
  • Data Matrix GF(256) polynomial comment corrected (0x12D = x^8+x^5+x^3+x^2+1; QR uses 0x11D).

Full changelog: pr-1.0.1...pr-1.1.0