Context
Micro QR codes are increasingly requested for space-constrained applications (packaging labels, small components). While no single competitor issue tracks this, the demand comes from the broader barcode ecosystem and users of libraries like bwip-js that support it.
Description
Micro QR Code is a compact variant of QR Code defined in ISO/IEC 18004 Annex C. It uses a single finder pattern (vs. three in standard QR) and supports versions M1-M4 with sizes from 11x11 to 17x17 modules. It is ideal for very small labels where a full QR code would be too large.
Current Status in etiket
The types and stubs already exist in src/encoders/qr/micro.ts:
export function encodeMicroQR(_text: string, _options?: MicroQROptions): boolean[][] {
throw new Error("Micro QR Code is not yet implemented");
}
The QRCodeOptions interface has a micro?: boolean field, but it is not wired up.
Proposed Solution
- Implement the Micro QR encoding algorithm in
src/encoders/qr/micro.ts:
- M1: Numeric only, no EC
- M2: Numeric + Alphanumeric, EC L/M
- M3: Numeric + Alphanumeric + Byte + Kanji, EC L/M/Q
- M4: All modes, EC L/M/Q
- Single finder pattern placement (top-left only)
- Micro QR specific format information encoding
- Wire up the
micro option in the main encodeQR function
- Export
encodeMicroQR from the public API
- Add a dedicated
microqr() convenience function or respect the micro: true option
Context
Micro QR codes are increasingly requested for space-constrained applications (packaging labels, small components). While no single competitor issue tracks this, the demand comes from the broader barcode ecosystem and users of libraries like bwip-js that support it.
Description
Micro QR Code is a compact variant of QR Code defined in ISO/IEC 18004 Annex C. It uses a single finder pattern (vs. three in standard QR) and supports versions M1-M4 with sizes from 11x11 to 17x17 modules. It is ideal for very small labels where a full QR code would be too large.
Current Status in etiket
The types and stubs already exist in
src/encoders/qr/micro.ts:The
QRCodeOptionsinterface has amicro?: booleanfield, but it is not wired up.Proposed Solution
src/encoders/qr/micro.ts:microoption in the mainencodeQRfunctionencodeMicroQRfrom the public APImicroqr()convenience function or respect themicro: trueoption