Release Label Tools 0.2.0
Verify / verify (push) Canceled after 0s

This commit is contained in:
2026-09-02 11:52:44 +02:00
parent 4e3df8d4a4
commit d3e43bea98
37 changed files with 1733 additions and 119 deletions
+17 -3
View File
@@ -1,15 +1,29 @@
# Architecture
The sheet engine keeps all physical geometry in millimetres and converts only
at the editor boundary. Alongside the fixed address, badge and asset layouts,
`labels/template.ts` validates a reusable v1 element model for draggable text,
image, barcode and shape elements. Merge expressions are fixed `{{field}}`
lookups; they never evaluate code. Bounds include an explicit bleed allowance,
and barcode elements report format-specific quiet-zone and minimum-size risks.
SVG pages use physical dimensions and application-owned escaped markup. PDF
export walks that generated markup into `pdf-lib` vector paths, rectangles and
embedded standard-font text; local PNG/JPEG assets remain image objects. No
page-wide rasterization is used. Unsupported WebP embedding remains visible in
SVG and is omitted from PDF rather than fetched or executed.
Label Tools separates untrusted input from rendering:
1. `labels/data.ts` uses toolbox helpers for bounded CSV/JSON parsing and the
browser cryptographic RNG for optional virtual fields.
2. `labels/stocks.ts` stores canonical millimetre geometry and validates every
preset/custom grid before rendering.
3. `labels/render.ts` maps scalar fields into three fixed layouts, escapes XML,
embeds validated local raster data, and places reviewed bwip-js output.
3. `labels/render.ts` maps scalar fields into three fixed layouts or the
validated designer model, escapes XML, embeds validated local raster data,
and places reviewed bwip-js output.
4. `labels/export.ts` exports exact SVG pages, deterministic fflate ZIPs, or
locally rasterized pdf-lib documents.
vector pdf-lib documents assembled from application-owned SVG markup.
The React workbench retains the last valid data model after parse errors and
limits interactive preview to the first 12 pages. Complete SVG export remains
+6 -4
View File
@@ -7,10 +7,12 @@ inside the symbol; they are never requested.
CSV/JSON structure, field lengths, record counts, image bytes/pixels, grid
dimensions, calibration and output pages are bounded. Object URLs are revoked.
User strings are normalized for label display and XML-escaped. Only built-in
templates are supported, and only locally decoded PNG/JPEG/WebP is embedded.
User strings are normalized for label display and XML-escaped. Imported
templates use a bounded, declarative v1 schema with no script or remote-resource
field, and only locally decoded PNG/JPEG/WebP is embedded.
Printing crosses a physical boundary the browser cannot verify: installed font
metrics, device drivers, page scaling, feed skew and stock tolerances. Use the
calibration controls and test on plain paper. PDF is a 144 DPI raster export and
does not embed or preserve font semantics.
calibration controls and test on plain paper. PDF uses vector geometry and
embedded standard fonts, but it does not preserve the selected system-font
metrics or provide archival guarantees.