Feat/zpl header commands#74
Conversation
…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.
There was a problem hiding this comment.
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.
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.
No description provided.