portakal-lite 0.0.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -32,6 +32,21 @@ const zplCode = zpl.compile(myLabel); // ZPL II commands
32
32
  const svg = zpl.preview(myLabel); // SVG preview
33
33
  ```
34
34
 
35
+ ### Fonts
36
+
37
+ `.text()` accepts any TSC font id via `font`:
38
+
39
+ - `"0"` — the scalable TrueType font. `size`/`xScale` are point sizes (or
40
+ multipliers of `fontBase` per `font0Mode`), with independent X/Y.
41
+ - `"1"`–`"8"` — fixed-pitch dot fonts (`TSC_DOT_FONTS`): `size`/`xScale` are
42
+ integer multipliers 1–10 of the base dot size (8×12, 12×20, 16×24, 24×32,
43
+ 32×48, 14×19 OCR-B, 21×27 OCR-B, 14×25 OCR-A).
44
+
45
+ ```ts
46
+ label({ width: 40, height: 30 }).text("CUT: 9.00 m", { x: 10, y: 10, font: "3", size: 3, xScale: 2 });
47
+ // → TEXT 10,10,"3",0,2,3,"CUT: 9.00 m"
48
+ ```
49
+
35
50
  ## Barcodes & QR codes
36
51
 
37
52
  ```ts
@@ -78,6 +93,16 @@ socket.end();
78
93
  // fs.writeFileSync("label.prn", commands);
79
94
  ```
80
95
 
96
+ TSC output uses LF (`\n`) line endings by default. If your printer firmware
97
+ requires CRLF, pass `lineEnding: "\r\n"` (either to `label()` or as the second
98
+ argument to `tsc.compile()`):
99
+
100
+ ```ts
101
+ const commands = tsc.compile(
102
+ label({ width: 40, height: 30, lineEnding: "\r\n" }).text("Hello", { x: 10, y: 10 }),
103
+ );
104
+ ```
105
+
81
106
  ### Receipt-style aligned lines
82
107
 
83
108
  ```ts