Skip to content

Feat/zpl header commands#74

Merged
u8array merged 5 commits into
mainfrom
feat/zpl-header-commands
May 19, 2026
Merged

Feat/zpl header commands#74
u8array merged 5 commits into
mainfrom
feat/zpl-header-commands

Conversation

@u8array
Copy link
Copy Markdown
Owner

@u8array u8array commented May 19, 2026

No description provided.

u8array added 3 commits May 19, 2026 19:26
…perties panel UX

Schema, generator, parser, and UI support for:
- ^PM mirror image
- ~SD instant darkness (emitted before ^XA)
- ^PR extended with slew + backfeed speeds
- ^PQ extended with pause-count, replicates, override-pause-count

Properties panel reorganised: collapsible sections (Output, Quantity
advanced, Printer optional, all closed by default), 3-col grid for the
speed group, 2-col grid for darkness (permanent / instant), mirror
checkbox visually paired with print orientation. Quantity advanced
moved into its own collapsible. Locale keys added for the new fields
and section headings.
Adds label-origin offsets (^LH x,y) and label-top shift (^LT y) as
output-only settings. Field coordinates remain absolute in the model;
the generator subtracts the configured offsets from each leaf's FO at
emit time (clamping at 0). Import keeps the existing normalisation
(field positions absorb the offset, ^LH/^LT are discarded).

^CF gains a width parameter (third positional slot). Parser persists
it, generator emits it. Generator emit order is reorganised so the
geometry block (^LH/^LT/^LS) groups together before the default font
(^CF).

Properties panel: offsets grid in the Output section (Home X / Home Y
/ Top shift), default-text-style grid expanded to 3 columns
(Font/Height/Width), suggestions list of Zebra built-in font IDs as
extracted module constant, datalist rendered once per panel. Override
pause count split into short label + tooltip via overridePauseCountHint
locale key; existing translations shortened.
The previous emit pasted height and width as comma-prefixed fragments,
which dropped the leading comma when height was unset. ^CFA,20 was
emitted instead of ^CFA,,20 — the printer interpreted 20 as height,
not width.

Build the positional slots in an array and join with commas, trimming
trailing empties. Three new tests cover ^CFA,,20, ^CF,,20, and the
trailing-empty trim case.
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for several advanced ZPL configuration commands, including origin offsets (^LH, ^LT), extended print quantity settings (^PQ), granular speed controls (^PR), instant darkness (~SD), and mirror imaging (^PM). The UI in the PropertiesPanel has been updated to expose these settings, and both the ZPL generator and parser have been extended to handle the new properties across various locales. Feedback was provided regarding the coordinate shifting logic in the generator, specifically suggesting the removal of coordinate clamping to zero to ensure that objects positioned outside the offset origin are correctly clipped rather than repositioned, maintaining layout fidelity.

Comment thread src/lib/zplGenerator.ts Outdated
u8array added 2 commits May 19, 2026 19:42
The ^LH/^LT compensation previously clamped negative results to 0,
which silently relocated fields into the visible area and broke the
editor's WYSIWYG guarantee. Emitting negative ^FO is undefined per
the Zebra spec and behaves inconsistently across printer families
(some clip, some wrap as unsigned).

Drop affected fields from the output instead. This is analogous to
the existing includeInExport=false path and to design-tool norms
where layers outside the artboard are not rendered.

Addresses Gemini PR review on #74.
The function handles both leaves and groups and can drop entries when
they clip — the new name reflects that. Added tests for single-axis
clipping and for groups with mixed clipped/visible children.
@u8array u8array merged commit c925a25 into main May 19, 2026
2 checks passed
@u8array u8array deleted the feat/zpl-header-commands branch May 20, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant