flutter_cpcl_utils 0.2.4
flutter_cpcl_utils: ^0.2.4 copied to clipboard
Generate CPCL label commands, preview labels in Flutter, and export preview PNG or PDF files.
Changelog #
0.2.4 #
- Rendered Text Generalization:
- Add script-neutral
renderedText()fluent method onCpclGenerator. - Add script-neutral
CpclRenderedTextdeclarative command for config-driven generation and previews. - Generalize Flutter-rendered bitmap rasterization to support any script (Khmer, Thai, Arabic, Devanagari, CJK, etc.) or custom font.
- Maintain full backward compatibility for
khmerText()andCpclKhmerTextas aliases/wrappers. - Update
CpclPreviewandCpclPreviewServiceto supportCpclRenderedTextwith identical rendering semantics. - Add architecture documentation in
doc/rendered_text_compatibility.md.
- Add script-neutral
- Graphics (Behavior Change):
bitmap(),renderedText(), andkhmerText()now emit standard CPCLCG(COMPRESSED-GRAPHICS) with raw 1-bit binary bytes instead of invalid binary data underEG. AddedcompressedGraphics()alias andexpandedGraphics()/CpclExpandedGraphicsfor 7-bit safe uppercase ASCII hexadecimalEGoutput. - Font Magnification (Behavior Change): Corrected
SETMAGfactor calculation intext()from zero-indexed(multiplier - 1)to direct 1-based documented factors (style.xMultiplierandstyle.yMultiplier). 2× magnification now emitsSETMAG 2 2instead ofSETMAG 1 1(which rendered at 1× on real printers). Magnification resets immediately withSETMAG 0 0. Added standalonesetMag(w, h)for persistent printer state management. - Line Print Mode & Session Correctness (Behavior Change): Corrected
SETLPto adhere to Zebra utility-session rules (Valid Session Types: Utilities sessions only).- Added canonical
setLinePrint()emitting! U1 SETLP .... - In declarative
_applyConfiguration(),linePrintOptionsis emitted before the label session header (! 0 ...), preventing bare utility commands inside page-mode label bodies. - Deprecated bare
setLp(), delegating safely tosetLinePrint(). - Distinguish resident font syntax (
font,size,lineSpacing) and TrueType font syntax (fontName,xScale,yScale,lineSpacing) viaCpclResidentLinePrintOptionsandCpclTrueTypeLinePrintOptions. LegacyunitWidthandunitHeightparameters are deprecated and retained for source compatibility.
- Added canonical
- Barcode Semantics & Validation (Behavior Change): Corrected parameter semantics for
BARCODEandVBARCODE:- Canonical properties on
CpclBarcodeOptionsare nowwidth(narrow bar unit-width,0..65535) andratio(wide-to-narrow bar ratio code). - Enforced valid discrete CPCL ratio codes (
0..4and20..30) viaCpclBarcodeRatiovalue class. - Enforced documented Zebra Link-OS command-level ranges: width
0..65535, height0..65535, coordinates0..65535(rejecting negative coordinates), and maximum payload limit of 8191 bytes. - Legacy
narrowandwideconstructor parameters and getters are retained as deprecated source-compatible aliases, with canonical parameters taking precedence.
- Canonical properties on
- Architecture Documentation: Added
doc/cpcl_command_coverage.mdanddoc/adr/0001-cpcl-protocol-command-model.mddocumenting CPCL command syntax, session types, and architectural decisions.
0.2.3 #
- Add script-neutral
renderedText()fluent method onCpclGenerator. - Add script-neutral
CpclRenderedTextdeclarative command for config-driven generation and previews. - Generalize Flutter-rendered bitmap rasterization to support any script (Khmer, Thai, Arabic, Devanagari, CJK, etc.) or custom font.
- Maintain full backward compatibility for
khmerText()andCpclKhmerTextas aliases/wrappers. - Update
CpclPreviewandCpclPreviewServiceto supportCpclRenderedTextwith identical rendering semantics. - Add architecture documentation in
doc/rendered_text_compatibility.md.
0.2.2 #
- Improve package API documentation coverage with comprehensive dartdoc comments across exported types.
- Add missing docs for declarative command classes and key methods (including
applyoverrides). - Keep package validation clean for publishing (
dart pub publish --dry-runwith zero warnings).
0.2.1 #
- Improve
CpclPreviewlayout stability inside bounded widgets and avoid rerender churn on ordinary rebuilds. - Add preview customization options for frame padding, border radius, box shadow, zoom interaction, and preview surface styling.
- Add optional checkerboard preview background to make light labels easier to inspect on screen.
- Refresh README examples and expand widget test coverage for preview behavior.
0.2.0 #
- Add declarative
CpclConfigurationandcommandssupport for config-driven label generation. - Add typed declarative commands such as
CpclText,CpclBarcode,CpclQrCode,CpclBox, andCpclKhmerText. - Add async
buildAsync()andpreviewAsync()support for labels that include Flutter-rendered text. - Add
CpclPreviewfor live in-app label previews andCpclPreviewServicefor PNG or PDF export. - Refresh the example app, README, and tests to cover the new generator and preview APIs.
0.1.0 #
- Replace the default package template with a usable CPCL command generator.
- Add chainable APIs for label setup, text, line, box, inverse line, barcode, vertical barcode, QR code, bitmap, and print commands.
- Add typed option objects for barcode, QR, and
SETLPconfiguration. - Add common CPCL control commands such as
contrast(),country(), andsetLp(). - Add Flutter-rendered bitmap text support for Khmer and other Unicode text.
- Document the package with sizing guidance and richer shipping-label examples.
- Add test coverage for sanitization, richer label flows, and typed options.