feat(registry): TLC39 (^BT) composite — barcodes complete (28/28)#119
Conversation
bwip-js has no native tlc39 encoder. TLC39 is a layout convention that combines two standard symbols per the TIA/ATIS spec: - Top: Code 39 carrying the 6-digit ECI, with a 'T' linkage flag appended to signal that a MicroPDF417 follows. - Bottom: MicroPDF417 carrying the alphanumeric serial, with the leading 'S' data identifier stripped. Compose both with stock bwip-js encoders and paint them onto a single canvas via renderTlc39Canvas. BarcodeObject special-cases the type so the standard buildBwipOptions / BCID pipeline never touches it. Round-trip ZPL stays correct; Labelary preview is unaffected (they don't support ^BT either). Registry pair, parser ^BT handler, generator toZPL, 32 locale entries, splitTlc39Content helper tests, parser round-trip tests. Tripwire updated for 35 object types.
There was a problem hiding this comment.
Code Review
This pull request introduces support for the TLC39 barcode symbology (ZPL command ^BT), including custom canvas rendering to combine Code 39 and MicroPDF417, ZPL parsing and serialization, and localized UI panels. The review feedback highlights several opportunities for improvement: fully parsing and utilizing the narrow bar width (w1) parameter of the ^BT command, passing the dynamic canvas scale to the rendering helper to ensure crisp rendering at different zoom levels, adding a defensive check for empty content, correcting a documentation comment regarding the stacked layout order, and expanding test coverage to assert the parsed module width.
Parse ^BT w1 (Code 39 narrow bar width) into a dedicated tlcModuleWidth field so an explicit value survives import instead of being silently overwritten by the most recent ^BY; flushField falls back to byModuleWidth only when w1 is absent. Pipe the editor scale + dpmm into renderTlc39Canvas and pick the bwip-js render scale via get1DBwipScale, matching the 1D-barcode pattern so the composite stays crisp at any zoom level. Defensive guard in splitTlc39Content against empty content. Fix stack-order doc comment in tlc39.ts (was 'below Code 39', actual layout is MicroPDF417 on top). Extend parser test to assert moduleWidth and add a ^BY-fallback case.
- renderTlc39Canvas composites at dpmm-aware display px (was using a
/4 mm heuristic that drifted at 12/24 dpmm); appends Code 39 "T"
linkage flag only on successful MicroPDF render.
- Enforce TLC39's 4-column MicroPDF417 geometry via bwip-js `columns: 4`
and snap requested rows to {4,6,8,10} (bwip-js throws otherwise).
- Honor `microPdfRows` prop in the renderer (was previously dead).
- Tighten ^BT h2 range to spec 1-10 (was 1-99) in parser, panel, schema.
- Add boundary, reject-out-of-range, r1-drop, no-serial round-trip,
and snap-helper unit tests.
|
/gemini revwiew |
|
Hello! It looks like you meant to invoke the Pull Request Review: TLC39 (^BT) SupportThis is a well-implemented addition to the registry. Supporting the TLC39 composite barcode by manually composing the Code 39 and MicroPDF417 components on a canvas is a clever and effective workaround for the lack of native Strengths:
Minor Observations:
Overall, this is a high-quality contribution. Great work on completing the barcode registry! |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request implements support for the TLC39 barcode symbology (a composite of Code 39 and MicroPDF417), including ZPL parsing, rendering, localization, and properties panel integration. While the implementation is comprehensive and well-tested, three important issues were identified during the review: first, stretching the Code 39 and MicroPDF417 components to a shared width in bwipHelpers.ts distorts their module widths and can make the barcode unscannable; second, a missing import for bwipjs in bwipHelpers.ts will lead to a runtime ReferenceError; and third, emitting a redundant ^BY command in tlc39.ts introduces potential global side effects on subsequent barcodes and should be omitted.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
No description provided.