Test corpus and reference provenance
Use this ledger to distinguish captured inputs, adapted templates, synthetic fixtures, external reference images and renderer baselines. Test execution and reference-update rules live in Testing.
- Independent page and drawing references cover all five languages.
- ZPL and EPL: carrier captures, production templates and demos.
- TSPL: real input sources and reference capture provenance.
- CPCL and DPL: vendor examples, manual samples and payload tests.
Specialized fixtures keep their provenance beside the data: reverse encoding, vector output, and Legacy DataMatrix.
Independent page and drawing references
The five jobs in testdata/page-order print the same
two 64×40-dot pages at 8 dpmm. The first has an upper-left corner mark and a
detached bar. The second moves the marks across the label. Two hand-specified
sets of rectangles produce the expected PNGs. e2e_page_order checks language
detection, page count, print order, and every pixel in the original and
formatted jobs. Regenerate the page references with
python3 testdata/page-order/generate_references.py (Pillow).
The six single-label references below run through both e2e_golden and
e2e_diff_report. Tests require the committed inputs and PNGs, compare exact
dimensions and pixel values, and run offline. Run the drawing cases with
cargo test --test e2e_golden spec_ and the two-page jobs with
cargo test --test e2e_page_order.
| Fixtures | What the images verify | Source |
|---|---|---|
epl_spec_line_order, epl_spec_gw |
Black, white and overlapping XOR regions in draw order. Cleared-bit ink, byte order and the next command after a counted binary graphic. | Zebra EPL2 Programming Guide, pp. 110, 117–120 and Zebra's GW byte example (archived copy) |
dpl_spec_offsets, dpl_spec_recall |
Bottom-left placement across metric and imperial offsets. Repeat rows in a native image download, two independent magnifications, and clipping at the right paper edge. | Honeywell DPL Command Reference, label-formatting commands and Datamax I & W Class manual, Appendix O |
zpl_spec_field_reverse, zpl_spec_by_defaults |
Reversal of overlapping fields at a shifted label home and reset after ^FS. Code 39 module/ratio/height inheritance and a single-field height override. |
Zebra field reverse and barcode field defaults |
The EPL GW input carries 24 raw bytes, including embedded line endings.
The parser and formatter tests exercise both the comma and line-feed
delimiters after the height and verify that the next command starts after
exactly the declared byte count. In vector PDF this fixture embeds a 24×8
image with an alpha mask. At one pixel per printer dot, Cairo reproduced the
reference exactly. Poppler Splash and PDFium sampled some bitmap edges
differently. At five pixels per dot, all three viewers matched the reference
at every source-dot center.
The EPL and DPL reference images use an 812×1624 canvas. Their independent
generators are testdata/unit/generate_epl_spec_references.py and
testdata/unit/generate_dpl_spec_references.py (Python and Pillow).
The ZPL PNGs are unmodified Labelary captures from 2026-12-01 at 813×1626.
The capture manifest records the SHA-256 digests of the posted jobs and returned PNGs.
To repeat a capture for inspection, run the following from the repository root
with either ZPL fixture name. The command writes a separate file.
name=zpl_spec_field_reverse
curl --fail --silent --show-error -H 'Accept: image/png' \
-H 'Content-Type: application/x-www-form-urlencoded' \
--data-binary "@testdata/unit/${name}.zpl" \
https://api.labelary.com/v1/printers/8dpmm/labels/4.005x8.01/0/ \
-o "/tmp/${name}.png"
ZPL and EPL
Seven synthetic testdata/unit/zpl_*.zpl fixtures cover the ^B0 Aztec alias,
^IM recall, ^IS bitmap saving, ^A@ orientation/filename parameters and
counted ^GFB payloads. The Labelary captures from November 17–18, 2026 use
8 dpmm and an 813 × 1626 pixel canvas. The source and reference hashes appear in capture provenance.
The binary fixture includes literal command prefixes and trailing CR/LF/TAB
bytes and must not undergo line-ending conversion. The named-font capture uses
an equivalent ^A0 control for Zebra's documented ^CF0 fallback because
Labelary applies different sizing to ^A@ with an unavailable font. Its request
source is retained beside the fixture. The saved-image edge fixture places a
mirrored image on paper wider than the print area by an odd number of dots.
It checks page loads, field placements and clipping at both paper edges.
These captures verify software rendering, not physical printer output.
The original USPS APO capture contains six truncated/lossy ^GFB fields. It
and its historical reference are preserved under testdata/invalid/, where a
regression requires an explicit truncation error. The adapted rendering fixture
uses valid ^GFA fields containing only the complete bitmap rows available to
the old text parser; missing original image pixels are not reconstructed.
Normalization details record
original and adapted hashes and each field's byte counts. Its new independent
reference is recorded in capture provenance.
testdata/unit/field_parameters.zpl is a synthetic, independent Labelary
reference for text direction and additional character spacing, captured on
November 6, 2026 at 8 dots/mm and 813 x 1626 pixels. Its adjacent provenance
JSON records the original source and PNG hashes. This covers fonts 0/A,
positive and negative gaps, upright reverse/vertical text and field reset;
it does not establish physical Zebra printer behavior. Detailed measurements
are in Rendering behavior.
Six additional frozen captures under testdata/field-parameters/ cover
rotated ^FO/^FT origins, explicit origin alignment, field-block alignment,
vertical wrapping and reverse-before-wrap ordering. Their portable
provenance.json records
the exact inputs, independent PNG hashes and actual canvas dimensions.
The interaction tests measure individual fields in raster and vector output;
they do not fit or realign an erroneous rendered field to the reference.
testdata/labels/ contains captured labels, adapted production templates and
synthetic carrier demos. The tables below distinguish those origins. Current
differences are regenerated in testdata/diffs/diff_report_labels.txt; limits
are maintained in Diff thresholds.
Provenance kinds
| Kind | Meaning |
|---|---|
| real (capture) | Real ZPL captured from a production print stream. Personal names, phone numbers, street addresses and tracking numbers are anonymized while preserving field formats, layout and graphics |
| real (template, adapted) | A real production label template; carrier-specific printer fonts (^SEE/^CW dot fonts) were normalized to scalable font 0 while keeping the authentic geometry, barcodes and graphics |
Real corpus
Captured production labels
| Label | Carrier / system | Source |
|---|---|---|
usps, usps_apo, usps_intl |
USPS eVS production stream | captured (anonymized); APO graphic payloads normalized as documented above |
ups, ups_surepost, ups_import_control |
UPS production waybills | captured (anonymized) |
fedex, fedex_express, fedex_ground |
FedEx production waybills | captured (anonymized) |
dhlpaket |
DHL Paket (DE) production | captured (anonymized) |
dhl_home_delivery |
DHL home delivery production | captured (anonymized) |
dhlparceluk |
DHL Parcel UK production | captured (anonymized) |
dhlparcelit |
DHL Parcel Italy production | captured (anonymized) |
dhlecommercetr |
DHL eCommerce Türkiye production | captured (anonymized) |
dpduk.epl |
DPD UK production (EPL) | captured (anonymized) |
pnldpd |
DPD pipeline production | captured (anonymized) |
dpdpl |
DPD Poland production | captured (anonymized) |
glscz, glsdk_return |
GLS CZ/DK production | captured (anonymized) |
swisspost |
Swiss Post production | captured (anonymized) |
posten |
Posten Norway production | captured (anonymized) |
porterbuddy |
Porterbuddy (NO) production | captured (anonymized) |
icapaket |
ICA Paket (SE) production | captured (anonymized) |
dbs |
DB Schenker (SE) production | captured (anonymized) |
brtit |
BRT Bartolini (IT) production | captured (anonymized) |
posteit |
Poste Italiane production | captured (anonymized) |
pocztex |
Pocztex (PL) production | captured (anonymized) |
bstc |
BSTC production | captured (anonymized) |
amazon, amazonshipping |
Amazon FBA / MXP5 production | captured (anonymized) |
jcpenney, kmart |
US retail routing production | captured (anonymized) |
kuehnenagel_intl, kuehnenagel_eselect |
Kuehne+Nagel (Centiro platform) | sahild-cen/Label_EDI_Validator_V3 real uploads (anonymized) |
bring |
Bring (SE), Centiro platform | same source as above (anonymized) |
labelary |
Labelary sample label | official demo |
Real production templates (adapted)
| Label | Carrier | Source |
|---|---|---|
cjlogistics |
CJ대한통운 (KR) warehouse template | sLogis-SLK/CS.WCS.PAS 대한통운_템플릿 — Korean dot-font setup normalized to font 0 |
correiosbr |
Correios Brasil SEDEX postagem | marcelofecchio/correios-api postagem.zpl — includes the genuine SEDEX service logo as ^GFA Z64 |
tnt_express |
TNT Express 12:00 (Centiro) | real capture from the Kuehne+Nagel/Centiro upload corpus (anonymized); replaces an earlier stylized demo |
dhl_express |
DHL Express Worldwide (Centiro) | same source (anonymized); replaces an earlier stylized demo |
Synthetic fixtures
A number of older golden fixtures in testdata/labels/ (e.g. auspost,
bpost, royalmail, canadapost, colissimo, correos, dpdde, evri,
inpost, ontrac, postnl, seur, yodel, dbschenker, purolator) are stylized demos authored from public label designs, kept
because they exercise rendering paths (QR/DataMatrix/PDF417 placement, rotated
text, ^GFA logos) against Labelary with tight tolerances. They are not
real captures and are listed here so nobody mistakes them for carrier
artifacts. DIFF_THRESHOLDS.md marks them implicitly; this note is the
authoritative provenance statement.
TSPL
Real-world TSPL/TSC label data used by the golden tests (tspl_real_* in
testdata/unit/). Provenance follows the repo convention: every file has a
real source; nothing here is synthesized. Reference PNGs were rendered by
labelixa.com (see
TSPL_BASELINES.md for the baseline strategy).
| Fixture | Source | Notes |
|---|---|---|
tspl_real_probe_text.tspl |
hyiger/filament-db tests/fixtures/tspl/02_probe_text.prn |
Text-only capability probe from a Rust 3D-filament inventory project |
tspl_real_probe_full.tspl |
hyiger/filament-db tests/fixtures/tspl/03_probe_full.prn |
Full element-kind probe (incl. REVERSE, magnified text) |
tspl_real_drybox.tspl |
hyiger/filament-db tests/fixtures/tspl/04_drybox_label.prn |
3D-printing drybox label |
tspl_real_te210.tspl |
nasnek/FlowStock flowstock_scanner_diagnostics_v1_TSC_TE210_100x72_working.prn |
TSC TE210 hardware capture (repo marks it "working") — 3 labels per stream |
tspl_real_sklad.tspl |
AndreySavastyuk/AndroidSklad01 app/src/main/assets/tspl_label.prn |
Russian warehouse app template; ${placeholder} tokens render as literal text (documented behavior) |
Reference provenance
tspl_spec_* are original synthetic labels with independently calculated
reference pixels. For the masks, regeneration command, and related geometry
and barcode checks, see offline checks against the TSC programming manual.
tspl_real_*.png references were fetched from the Labelixa API on
2026-10-12. The golden suite and diff report require those committed
captures and apply the per-label tolerances in Diff thresholds.
CPCL and DPL
Each cpcl_real_* / dpl_real_* fixture comes from a renderer vendor's example
corpus or a printer manual. The source tables record adaptations explicitly.
Reference renderers
| Language | Reference | Notes |
|---|---|---|
| CPCL | api.labelixa.com/v1/cpcl/render |
Recorded external comparison; an interpretation of the CPCL guide at 203 dpi covering a subset (text, BOX/LINE, 128/39/EAN-13/UPC-A). Same pipeline as the TSPL corpus. |
| DPL | layoutview.evolabel.com (Layout view) |
Recorded server-side DPL comparison (Evolabel print-applicator preview, ~11.8 px/mm ≈ 300 dpi). Not printer-verified; used as the external comparison like portakal was for TSPL triangulation. |
Both clients cache previews under testdata/labelixa_cache/. For CPCL, the
golden suite and diff report require the five committed Labelixa captures and
the four analytical references below. Missing files fail by name, including
when LABELIZE_UPDATE_GOLDEN is set. The existing cpcl_2d_graphics renderer
snapshot tracks the combined layout.
CPCL checks against the Zebra programming guide
These original jobs follow Zebra's CPCL Programming Guide for Link-OS Enabled
Printers (P1073699-001 Rev. A) and use one pixel per dot at 8 dpmm. Their expected masks
are written as coordinates and rows of ink in
generate_cpcl_spec_references.py.
Run python3 testdata/unit/generate_cpcl_spec_references.py with Pillow to
regenerate the four reference PNGs offline.
| Case | Independent check | Zebra reference |
|---|---|---|
cpcl_spec_inverse_order |
A line overlaps existing black and white areas. Later ink crosses the inverted band. A diagonal exercises the stroke path. Line endpoints and stroke thickness are checked in printer dots. | INVERSE-LINE, pp. 114–115, LINE and measured output, pp. 118–119 |
cpcl_spec_diagonals |
Ascending and descending 45° lines include their endpoints and extend to the right. A thickness argument of 3 produces a four-dot horizontal span. | LINE output, p. 119 |
cpcl_spec_eg, cpcl_spec_cg |
Hexadecimal and binary encodings print the same asymmetric artwork and a separate marker. The CG data contains CR, LF, NUL and non-UTF-8 bytes. The header offset moves both marks eight dots to the right. | Header offset, p. 38, CG, pp. 94–95, EG, pp. 104–105 |
| QR and PDF417 | RXing decodes the final PNGs at two module pitches per symbol. Pixel checks measure the QR finder and the PDF417 start pattern and row pitch. Pitch values use their absolute magnitude. A zero QR unit width, PDF417 module width or PDF417 row height suppresses the symbol and preserves the following graphic. | PDF417, pp. 73–76, QR, pp. 78–82 |
The original single-bit output image on guide p. 119 shows that an axis-aligned
line from device coordinate 30 to 200 spans 171 dots and thickness 25 spans
26 dots. Applying this rule changes some Labelixa comparisons: shipping
16.12% to 16.46%, route label 12.24% to 12.45%, and receipt 9.54% to 9.68%.
All three use their existing thresholds. The refreshed cpcl_2d_graphics
renderer snapshot changes only in its inverse-line region.
The metric offset test also renders the same 10 × 6 mm label at 8 and 12 dpmm. A 2 mm header offset and a graphic at (1 mm, 2 mm) put the first dot at (24, 16) and (36, 24), respectively.
Zebra notes that a thick diagonal inverse line can invert some dots twice. The exact inverse-line case covers a one-dot diagonal. Printer-specific overlap on wider inverse diagonals remains unverified. INVERSE-LINE example, p. 115
Parser and payload regression coverage
The language review also checks behavior that a visual corpus cannot reliably
detect. tests/unit_cpcl_parser.rs, tests/unit_dpl_parser.rs and
tests/unit_cpcl_dpl_robustness.rs cover counted payload boundaries, all byte
values, malformed records, formatter round trips and arbitrary input. The
forward-render tests in tests/e2e_cpcl_dpl_payloads.rs compare every CPCL
bitmap pixel with its input bit and independently decode DPL DataMatrix output
at 8 and 12 dpmm, before and after source formatting.
The command semantics come from Zebra's
CPCL Programming Guide
(sections 3.3.2, 6.7, 6.11, 6.19 and 6.34) and Honeywell's
DPL Command Reference
(T, W1C, W1f/W1F, Z, U and scalable font records). DPL byte counts include
the barcode option fields after the count; they override record terminators.
Tnn takes two hexadecimal digits and changes only the next format record.
The existing dpl_2d_graphics fixture now specifies 200 explicitly for its
ECC 200 symbol, correcting the previous 000 command without replacing its
reference PNG. Its W1f Aztec record includes the four default option digits
before AZTEC DATA. Legacy DPL DataMatrix qualities and unequal horizontal/vertical
modules remain unsupported and now fail explicitly. QR structured append and
DPL QR hex-ASCII modes also fail explicitly. PDF417 accepts UTF-8 and embedded
control characters; non-UTF-8 PDF417 payloads are rejected because its shared
encoder currently takes text. Font substitution and the previously documented
printer-only/unsupported commands remain limitations of these frontends.
The dpl_text_styles renderer baseline was regenerated after removing the
erroneously printed scalable-size fields (P015P015). Its 0.01% tolerance is
unchanged. External reference PNGs are unchanged; the scalable-text assertions
and independent box-edge pixel check cover the intended semantic corrections.
CPCL fixtures — Labelixa/thermal-printer-examples
Source: https://github.com/Labelixa/thermal-printer-examples (MIT, © 2026 Newempo LLC), fetched 2026-10-25.
| Fixture | Source file | Content |
|---|---|---|
cpcl_real_asset_tag |
cpcl/asset-tag-2x1.cpcl |
Asset tag 2×1": fonts 4/7, Code 39 (ratio 2, no HRI) |
cpcl_real_route_label |
cpcl/route-label-2x2.cpcl |
Delivery route 2×2": BOX border, LINE rule, TEXT270, Code 128 |
cpcl_real_receipt |
cpcl/receipt-label-2x3.cpcl |
Delivery note 2×3": text block, LINE, Code 128 |
Unmodified byte-for-byte from the corpus.
DPL fixtures — M-Class DPL Programmer's Manual (Appendix B)
Source: M-Class DPL Programmer's Manual, Rev B (Datamax-O'Neil, P/N 88-2302-01), Appendix B "Sample Programs".
| Fixture | Source | Content | Adaptation |
|---|---|---|---|
dpl_real_manual_component |
Figure B-1 sample (Basic/C/ASCII programs) | Electronic component label: smooth font 9 (008 = A18), Code 39 a with 6:2 modules, H07/D11 |
none — verbatim sample |
dpl_real_manual_order |
"VB Application Generating DPL" sample | Order-picking label: font 9 headings/values, five Code 39 fields, box record | field values filled in with plausible data (SO-44715, NORTHWIND SUPPLY, …); the 1Y…SLANT1 stored-image record is dropped (the sample omits the SLANT1 image download); the ~-alternative STX is written as the standard 0x02 byte |
Current per-fixture tolerances are in Diff thresholds;
regenerated measurements are in testdata/diffs/diff_report_unit.txt. External
font substitutions and barcode geometry can differ substantially. A renderer
baseline protects regressions but does not independently establish printer
accuracy.