Skip to content

Preflight: no warning for a Code 128 quiet zone under 10 modules, or for short bars #668

Backlog

Description

@styl5030

Follow-up to #660. As you suggested, the change is attached as a patch (applies with git am on top of 5485f91a).

Problem
For barcode size, preflight only checks the module width. A GS1-128 that is 5 dots tall with a 2-dot module, placed at x = 0, gets no warning.

Proposed change

  • barcodeQuietZone warns when a Code 128 (GS1-128 included) has fewer than 10 modules between its bars and the label edge, on either side (ISO/IEC 15417). It is measured along the symbol (left and right for N/I, top and bottom for R/B), against the label the code sits on when the liner carries labels across. It is skipped when the code already gets an off-label warning (outside or clipped).
  • barcodeTooShort warns when 1D bars are shorter than a new design setting, minBarHeightMm ("Min. bar height" in the label panel, below "Labels across"). It is unset by default, so nothing changes until a user sets it.
  • The safe-area input and the new one share a small OptionalMmField.

Tests
preflight.test.ts: left, right, top and bottom edges, exactly 10 modules, labels across, an HRI wider than the bars, Code 39 not checked, minimum unset, 0 and set. The six warning cases fail on main; the other two check that nothing is raised. One existing fixture moves from x = 10 to x = 40, since a Code 128 at x = 10 (5 modules) now gets a quiet-zone warning. The two checks of settings that are not written to the ZPL now include minBarHeightMm, and a new case shows it leaves the ZPL unchanged. pnpm lint, tsc -b and pnpm test pass.

To check

  • QUIET_ZONE_MODULES can take other symbologies with the same zone on both sides; EAN/UPC would need separate left and right values.
  • The non-English strings are machine translations.
  • Happy to split the two checks if you prefer.

zplab-barcode-quiet-zone-height.patch

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions