@levischuck/receiptline 0.0.4 → 0.1.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
@@ -1,278 +1,315 @@
1
- # SVG-only ReceiptLine
2
-
3
- Markdown for receipts. Printable digital receipts. 🧾
4
- Generate receipt printer commands and images.
5
-
6
- ReceiptLine is the receipt description language that expresses the output image of small roll paper.
7
- It supports printing paper receipts using a receipt printer and displaying electronic receipts on a POS system or smartphone.
8
- It can be described simply with receipt markdown text data that does not depend on the paper width.
9
-
10
- # Installation
11
-
12
- ```bash
13
- $ npm install @levischuck/receiptline
14
- ```
15
-
16
- # Usage
17
-
18
- `receiptline.transform()` method transforms ReceiptLine document to printer commands or SVG images.
19
-
20
- ```javascript
21
- import { transform, SvgTarget } from "@levischuck/receiptline";
22
-
23
- const svgTarget = new SvgTarget();
24
- svgTarget.setDefaultFont("'Atkinson Hyperlegible Mono'");
25
- const body = `Example Receipt
26
- (Merchant Copy)
27
- ---
28
-
29
- | Product | Qty| Price
30
- --
31
- |Pad Thai | 1| 14.99
32
- |Spring Roll | 1| 4.99
33
- | | |
34
- | | Subtotal| 19.98
35
- | | Tax (6%)| 1.20
36
- | | Convenience Fee| 0.99
37
- | | Total| 22.17
38
-
39
- Please Sign:
40
-
41
-
42
-
43
- ---
44
-
45
- {c:https://levischuck.com;o:qrcode,6}
46
-
47
- Please Take our Survey`;
48
-
49
- const {svg, width, height} = transform(body, {
50
- cpl: charactersPerLine,
51
- charWidth: charWidth,
52
- target: svgTarget,
53
- });
54
-
55
- // Do something interesting with the svg afterwards
56
- ```
57
-
58
- ## Method
59
-
60
- `transform(doc[, options])`
61
-
62
- ### Parameters
63
-
64
- - `doc`
65
- - a string of ReceiptLine document
66
- - `options`
67
- - an object of printer configuration
68
-
69
- ### Return value
70
-
71
- - SVG Image with expected width and height
72
-
73
- ## Printer configuration
74
-
75
- - `cpl`
76
- - characters per line (default: `48`)
77
- - `charWidth`
78
- - dot width of each character (default: `12`).
79
- - `spacing`
80
- - `false`: no line spacing (default)
81
- - `true`: line spacing
82
- - `margin` (for printer)
83
- - print margin (left) (range: `0` - `24`, default: `0`)
84
- - `marginRight` (for printer)
85
- - print margin (right) (range: `0` - `24`, default: `0`)
86
- - `target` What implementation to use (currently only SVG, instantiate your own to set additional configuration like font)
87
- - `encoding`
88
- - `multilingual` (default), others exist if you need to look. They mostly adjust line spacing and default fonts.
89
-
90
- `cpl * charWidth` will be the output width, which by default is 576 dots.
91
-
92
- # Examples
93
- ### example/data/\*
94
-
95
- The documents (receipt markdown text) are the same as the examples in the OFSC ReceiptLine Specification.
96
-
97
- # Grammar
98
-
99
- ## Structure
100
-
101
- The receipt is made of a table, which separates each column with a pipe `|`.
102
-
103
- |Line|Content|Description|
104
- |---|---|---|
105
- |_column_<br><code>&#x7c;</code> _column_ <code>&#x7c;</code><br><code>&#x7c;</code> _column_<br>_column_ <code>&#x7c;</code>|Text<br>Property|Single column|
106
- |_column_ <code>&#x7c;</code> _column_ <br><code>&#x7c;</code> _column_ <code>&#x7c;</code> _column_ <code>&#x7c;</code><br><code>&#x7c;</code> _column_ <code>&#x7c;</code> _column_<br>_column_ <code>&#x7c;</code> _column_ <code>&#x7c;</code>|Text|Double column|
107
- |_column_ <code>&#x7c;</code> _..._ <code>&#x7c;</code> _column_<br><code>&#x7c;</code> _column_ <code>&#x7c;</code> _..._ <code>&#x7c;</code> _column_ <code>&#x7c;</code><br><code>&#x7c;</code> _column_ <code>&#x7c;</code> _..._ <code>&#x7c;</code> _column_<br>_column_ <code>&#x7c;</code> _..._ <code>&#x7c;</code> _column_ <code>&#x7c;</code>|Text|Multiple columns|
108
-
109
- ## Alignment
110
-
111
- The column is attracted to the pipe `|` like a magnet.
112
- <code>&#x2423;</code> means one or more whitespaces.
113
-
114
- |Column|Description|
115
- |---|---|
116
- |_column_<br><code>&#x7c;</code>_column_<code>&#x7c;</code><br><code>&#x7c;&#x2423;</code>_column_<code>&#x2423;&#x7c;</code>|Center|
117
- |<code>&#x7c;</code>_column_<br><code>&#x7c;</code>_column_<code>&#x2423;&#x7c;</code><br>_column_<code>&#x2423;&#x7c;</code>|Left|
118
- |_column_<code>&#x7c;</code><br><code>&#x7c;&#x2423;</code>_column_<code>&#x7c;</code><br><code>&#x7c;&#x2423;</code>_column_|Right|
119
-
120
- ## Text
121
-
122
- The text is valid for any column.
123
-
124
- ```
125
- Asparagus | 0.99
126
- Broccoli | 1.99
127
- Carrot | 2.99
128
- ---
129
- ^TOTAL | ^5.97
130
- ```
131
-
132
- Characters are printed in a monospace font (12 x 24 px).
133
- Wide characters are twice as wide as Latin characters (24 x 24 px).
134
- Control characters are ignored.
135
-
136
- ## Special characters in text
137
-
138
- Special characters are assigned to characters that are rarely used in the receipt.
139
-
140
- |Special character|Description|
141
- |---|---|
142
- |`\`|Character escape|
143
- |<code>&#x7c;</code>|Column delimiter|
144
- |`{`|Property delimiter (Start)|
145
- |`}`|Property delimiter (End)|
146
- |`-` (1 or more, exclusive)|Horizontal rule|
147
- |`=` (1 or more, exclusive)|Paper cut|
148
- |`~`|Space|
149
- |`_`|Underline|
150
- |`"`|Emphasis|
151
- |`` ` ``|Invert|
152
- |`^`|Double width|
153
- |`^^`|Double height|
154
- |`^^^`|2x size|
155
- |`^^^^`|3x size|
156
- |`^^^^^`|4x size|
157
- |`^^^^^^`|5x size|
158
- |`^^^^^^^` (7 or more)|6x size|
159
-
160
- ## Escape sequences in text
161
-
162
- Escape special characters.
163
-
164
- |Escape sequence|Description|
165
- |---|---|
166
- |`\\`|&#x5c;|
167
- |<code>&#x5c;&#x7c;</code>|&#x7c;|
168
- |`\{`|&#x7b;|
169
- |`\}`|&#x7d;|
170
- |`\-`|&#x2d; (Cancel horizontal rule)|
171
- |`\=`|&#x3d; (Cancel paper cut)|
172
- |`\~`|&#x7e;|
173
- |`\_`|&#x5f;|
174
- |`\"`|&#x5f;|
175
- |``\` ``|&#x60;|
176
- |`\^`|&#x5e;|
177
- |`\n`|Wrap text manually|
178
- |`\x`_nn_|Hexadecimal character code|
179
- |`\`_char_ (Others)|Ignore|
180
-
181
- ## Properties
182
-
183
- The property is valid for lines with a single column.
184
-
185
- ```
186
- { width: * 10; comment: the column width is specified in characters }
187
- ```
188
-
189
- |Key|Abbreviation|Value|Case-sensitive|Default|Saved|Description|
190
- |---|---|---|---|---|---|---|
191
- |`image`|`i`|_base64 png format_|✓|-|-|Image<br>(Recommended: monochrome, critical chunks only)|
192
- |`code`|`c`|_textdata_|✓|-|-|Barcode / 2D code|
193
- |`option`|`o`|_see below_|-|`code128 2 72 nohri 3 l`|✓|Barcode / 2D code options<br>(Options are separated by commas or one or more whitespaces)|
194
- |`align`|`a`|`left`<br>`center`<br>`right`|-|`center`|✓|Line alignment<br>(Valid when line width &lt; CPL)|
195
- |`width`|`w`|`auto`<br>`*`<br>`0` -|-|`auto`<br>(`*` for all columns)|✓|Column widths (chars)<br>(Widths are separated by commas or one or more whitespaces)|
196
- |`border`|`b`|`line`<br>`space`<br>`none`<br>`0` - `2`|-|`space`|✓|Column border (chars)<br>(Border width: line=1, space=1, none=0)|
197
- |`text`|`t`|`wrap`<br>`nowrap`|-|`wrap`|✓|Text wrapping|
198
- |`command`|`x`|_textdata_|✓|-|-|Device-specific commands|
199
- |`comment`|`_`|_textdata_|✓|-|-|Comment|
200
-
201
- ## Barcode options
202
-
203
- Barcode options are separated by commas or one or more whitespaces.
204
-
205
- |Barcode option|Description|
206
- |---|---|
207
- |`upc`|UPC-A, UPC-E<br>(Check digit can be omitted)|
208
- |`ean`<br>`jan`|EAN-13, EAN-8<br>(Check digit can be omitted)|
209
- |`code39`|CODE39|
210
- |`itf`|Interleaved 2 of 5|
211
- |`codabar`<br>`nw7`|Codabar (NW-7)|
212
- |`code93`|CODE93|
213
- |`code128`|CODE128|
214
- |`2` - `4`|Barcode module width (px)|
215
- |`24` - `240`|Barcode module height (px)|
216
- |`hri`|With human readable interpretation|
217
- |`nohri`|Without human readable interpretation|
218
-
219
- ## 2D code options
220
-
221
- 2D code options are separated by commas or one or more whitespaces.
222
-
223
- |2D code option|Description|
224
- |---|---|
225
- |`qrcode`|QR Code|
226
- |`3` - `8`|Cell size (px)|
227
- |`l`<br>`m`<br>`q`<br>`h`|Error correction level|
228
-
229
- ## Special characters in property values
230
-
231
- Special characters in property values are different from special characters in text.
232
-
233
- |Special character|Description|
234
- |---|---|
235
- |`\`|Character escape|
236
- |<code>&#x7c;</code>|Column delimiter|
237
- |`{`|Property delimiter (Start)|
238
- |`}`|Property delimiter (End)|
239
- |`:`|Key-value separator|
240
- |`;`|Key-value delimiter|
241
-
242
- ## Escape sequences in property values
243
-
244
- Escape special characters.
245
-
246
- |Escape sequence|Description|
247
- |---|---|
248
- |`\\`|&#x5c;|
249
- |<code>&#x5c;&#x7c;</code>|&#x7c;|
250
- |`\{`|&#x7b;|
251
- |`\}`|&#x7d;|
252
- |`\;`|&#x3b;|
253
- |`\n`|New line|
254
- |`\x`_nn_|Hexadecimal character code|
255
- |`\`_char_ (Others)|Ignore|
256
-
257
- # Why use this one over the reference implementation?
258
-
259
- The original library has a weird hack to generate UUIDs on insecure contexts to get around a [currently debated WebCrypto standards detail](https://github.com/w3c/webcrypto/issues/408).
260
- This prevented me from deploying to Cloudflare workers.
261
- This fork and typescript adjustment is enough to unblock my objective.
262
-
263
- I also wanted to use a diferent font.
264
-
265
- # License
266
-
267
- Apache 2 Licensed, per the [original source](https://github.com/receiptline/receiptline)
268
-
269
- The word "QR Code" is registered trademark of DENSO WAVE INCORPORATED
270
- http://www.denso-wave.com/qrcode/faqpatent-e.html
271
-
272
- # Author
273
-
274
- Open Foodservice System Consortium
275
- http://www.ofsc.or.jp/
276
-
277
- Levi Schuck
278
- https://levischuck.com/
1
+ # ReceiptLine
2
+
3
+ Markdown for receipts. Printable digital receipts. &#x1f9fe;
4
+ Generate receipt printer commands, SVG images, and HTML documents.
5
+
6
+ ReceiptLine is the receipt description language that expresses the output image of small roll paper.
7
+ It supports printing paper receipts using a receipt printer and displaying electronic receipts on a POS system or smartphone.
8
+ It can be described simply with receipt markdown text data that does not depend on the paper width.
9
+
10
+ # Installation
11
+
12
+ ```bash
13
+ $ npm install @levischuck/receiptline
14
+ ```
15
+
16
+ # Usage
17
+
18
+ `receiptline.transform()` method transforms ReceiptLine document to printer commands, SVG images, or HTML documents.
19
+
20
+ ```javascript
21
+ import { transform, SvgTarget, HtmlTarget } from "@levischuck/receiptline";
22
+
23
+ const body = `Example Receipt
24
+ (Merchant Copy)
25
+ ---
26
+
27
+ {w: * 4 8}
28
+ {b:line}
29
+ ||Product | Qty| Price
30
+ |--
31
+ ||Pad Thai | 1| 14.99
32
+ ||Spring Roll | 1| 4.99
33
+ |--
34
+ {w:* 8}
35
+ || Subtotal| 19.98
36
+ || Tax (6%)| 1.20
37
+ || Convenience Fee| 0.99
38
+ || Total| 22.17
39
+ ---
40
+
41
+ {b:space}
42
+ {w:auto}
43
+ Please Sign:
44
+
45
+
46
+
47
+ ---
48
+
49
+ {c:https://levischuck.com;o:qrcode,6}
50
+
51
+ Please Take our Survey`;
52
+
53
+ // SVG Target
54
+ const svgTarget = new SvgTarget();
55
+ svgTarget.setDefaultFont("'Atkinson Hyperlegible Mono'");
56
+ const {content: svg, width, height} = await transform(body, {
57
+ cpl: charactersPerLine,
58
+ charWidth: charWidth,
59
+ target: svgTarget,
60
+ });
61
+
62
+ // HTML Target
63
+ const htmlTarget = new HtmlTarget();
64
+ htmlTarget.setDefaultFont("'Google Sans Code', monospace");
65
+ htmlTarget.setActualFontCharacterWidth(13.2); // Actual measured width of your font
66
+ htmlTarget.setCharHeight(24); // Character height in pixels
67
+ const {content: html, width: htmlWidth, height: htmlHeight} = await transform(body, {
68
+ cpl: charactersPerLine,
69
+ charWidth: charWidth,
70
+ target: htmlTarget,
71
+ });
72
+ c
73
+ // Do something interesting with the SVG or HTML afterwards
74
+ ```
75
+
76
+ ## Method
77
+
78
+ `transform(doc[, options])`
79
+
80
+ ### Parameters
81
+
82
+ - `doc`
83
+ - a string of ReceiptLine document
84
+ - `options`
85
+ - an object of printer configuration
86
+
87
+ ### Return value
88
+
89
+ - `content`: SVG Image (for SvgTarget) or HTML string (for HtmlTarget)
90
+ - `width`: Width of the generated content in pixels
91
+ - `height`: Height of the generated content in pixels
92
+
93
+ ## Printer configuration
94
+
95
+ - `cpl`
96
+ - characters per line (default: `48`)
97
+ - `charWidth`
98
+ - dot width of each character (default: `12`).
99
+ - `spacing`
100
+ - `false`: no line spacing (default)
101
+ - `true`: line spacing
102
+ - `margin` (for printer)
103
+ - print margin (left) (range: `0` - `24`, default: `0`)
104
+ - `marginRight` (for printer)
105
+ - print margin (right) (range: `0` - `24`, default: `0`)
106
+ - `target` What implementation to use (SvgTarget for SVG output, HtmlTarget for HTML output, instantiate your own to set additional configuration like font)
107
+ - `encoding`
108
+ - `multilingual` (default), others exist if you need to look. They mostly adjust line spacing and default fonts.
109
+
110
+ `cpl * charWidth` will be the output width, which by default is 576 dots.
111
+
112
+ ## HTML Target Configuration
113
+
114
+ The HTML target provides additional configuration options to account for differences with web fonts and the defaults this library expects for a thermal printer.
115
+
116
+ - `setDefaultFont(font: string)` - Sets the CSS font-family for the receipt (default: "'Courier Prime', monospace")
117
+ - `setActualFontCharacterWidth(width: number | undefined)` - Sets the actual measured character width of your font in pixels. It'll keep the text from going off the side when correctly set.
118
+ - `setCharHeight(height: number | undefined)` - Explicitly sets the character height in pixels. If not set, defaults to `charWidth * 2` (usually 12 * 2)
119
+
120
+ When using the HTML target, you may need to measure your font's actual character width for optimal layout. This is especially important when using web fonts that don't fit the 12 dot wide, 24 dot tall convention.
121
+
122
+ ```javascript
123
+ const htmlTarget = new HtmlTarget();
124
+ htmlTarget.setDefaultFont("'Google Sans Code', monospace");
125
+ htmlTarget.setActualFontCharacterWidth(13.2);
126
+ htmlTarget.setCharHeight(24.7);
127
+ ```
128
+
129
+ # Examples
130
+ ### example/data/\*
131
+
132
+ The documents (receipt markdown text) are the same as the examples in the OFSC ReceiptLine Specification.
133
+
134
+ # Grammar
135
+
136
+ ## Structure
137
+
138
+ The receipt is made of a table, which separates each column with a pipe `|`.
139
+
140
+ |Line|Content|Description|
141
+ |---|---|---|
142
+ |_column_<br><code>&#x7c;</code> _column_ <code>&#x7c;</code><br><code>&#x7c;</code> _column_<br>_column_ <code>&#x7c;</code>|Text<br>Property|Single column|
143
+ |_column_ <code>&#x7c;</code> _column_ <br><code>&#x7c;</code> _column_ <code>&#x7c;</code> _column_ <code>&#x7c;</code><br><code>&#x7c;</code> _column_ <code>&#x7c;</code> _column_<br>_column_ <code>&#x7c;</code> _column_ <code>&#x7c;</code>|Text|Double column|
144
+ |_column_ <code>&#x7c;</code> _..._ <code>&#x7c;</code> _column_<br><code>&#x7c;</code> _column_ <code>&#x7c;</code> _..._ <code>&#x7c;</code> _column_ <code>&#x7c;</code><br><code>&#x7c;</code> _column_ <code>&#x7c;</code> _..._ <code>&#x7c;</code> _column_<br>_column_ <code>&#x7c;</code> _..._ <code>&#x7c;</code> _column_ <code>&#x7c;</code>|Text|Multiple columns|
145
+
146
+ ## Alignment
147
+
148
+ The column is attracted to the pipe `|` like a magnet.
149
+ <code>&#x2423;</code> means one or more whitespaces.
150
+
151
+ |Column|Description|
152
+ |---|---|
153
+ |_column_<br><code>&#x7c;</code>_column_<code>&#x7c;</code><br><code>&#x7c;&#x2423;</code>_column_<code>&#x2423;&#x7c;</code>|Center|
154
+ |<code>&#x7c;</code>_column_<br><code>&#x7c;</code>_column_<code>&#x2423;&#x7c;</code><br>_column_<code>&#x2423;&#x7c;</code>|Left|
155
+ |_column_<code>&#x7c;</code><br><code>&#x7c;&#x2423;</code>_column_<code>&#x7c;</code><br><code>&#x7c;&#x2423;</code>_column_|Right|
156
+
157
+ ## Text
158
+
159
+ The text is valid for any column.
160
+
161
+ ```
162
+ Asparagus | 0.99
163
+ Broccoli | 1.99
164
+ Carrot | 2.99
165
+ ---
166
+ ^TOTAL | ^5.97
167
+ ```
168
+
169
+ Characters are printed in a monospace font (12 x 24 px).
170
+ Wide characters are twice as wide as Latin characters (24 x 24 px).
171
+ Control characters are ignored.
172
+
173
+ ## Special characters in text
174
+
175
+ Special characters are assigned to characters that are rarely used in the receipt.
176
+
177
+ |Special character|Description|
178
+ |---|---|
179
+ |`\`|Character escape|
180
+ |<code>&#x7c;</code>|Column delimiter|
181
+ |`{`|Property delimiter (Start)|
182
+ |`}`|Property delimiter (End)|
183
+ |`-` (1 or more, exclusive)|Horizontal rule|
184
+ |`=` (1 or more, exclusive)|Paper cut|
185
+ |`~`|Space|
186
+ |`_`|Underline|
187
+ |`"`|Emphasis|
188
+ |`` ` ``|Invert|
189
+ |`^`|Double width|
190
+ |`^^`|Double height|
191
+ |`^^^`|2x size|
192
+ |`^^^^`|3x size|
193
+ |`^^^^^`|4x size|
194
+ |`^^^^^^`|5x size|
195
+ |`^^^^^^^` (7 or more)|6x size|
196
+
197
+ ## Escape sequences in text
198
+
199
+ Escape special characters.
200
+
201
+ |Escape sequence|Description|
202
+ |---|---|
203
+ |`\\`|&#x5c;|
204
+ |<code>&#x5c;&#x7c;</code>|&#x7c;|
205
+ |`\{`|&#x7b;|
206
+ |`\}`|&#x7d;|
207
+ |`\-`|&#x2d; (Cancel horizontal rule)|
208
+ |`\=`|&#x3d; (Cancel paper cut)|
209
+ |`\~`|&#x7e;|
210
+ |`\_`|&#x5f;|
211
+ |`\"`|&#x5f;|
212
+ |``\` ``|&#x60;|
213
+ |`\^`|&#x5e;|
214
+ |`\n`|Wrap text manually|
215
+ |`\x`_nn_|Hexadecimal character code|
216
+ |`\`_char_ (Others)|Ignore|
217
+
218
+ ## Properties
219
+
220
+ The property is valid for lines with a single column.
221
+
222
+ ```
223
+ { width: * 10; comment: the column width is specified in characters }
224
+ ```
225
+
226
+ |Key|Abbreviation|Value|Case-sensitive|Default|Saved|Description|
227
+ |---|---|---|---|---|---|---|
228
+ |`image`|`i`|_base64 png format_|✓|-|-|Image<br>(Recommended: monochrome, critical chunks only)|
229
+ |`code`|`c`|_textdata_|✓|-|-|Barcode / 2D code|
230
+ |`option`|`o`|_see below_|-|`code128 2 72 nohri 3 l`|✓|Barcode / 2D code options<br>(Options are separated by commas or one or more whitespaces)|
231
+ |`align`|`a`|`left`<br>`center`<br>`right`|-|`center`|✓|Line alignment<br>(Valid when line width &lt; CPL)|
232
+ |`width`|`w`|`auto`<br>`*`<br>`0` -|-|`auto`<br>(`*` for all columns)|✓|Column widths (chars)<br>(Widths are separated by commas or one or more whitespaces)|
233
+ |`border`|`b`|`line`<br>`space`<br>`none`<br>`0` - `2`|-|`space`|✓|Column border (chars)<br>(Border width: line=1, space=1, none=0)|
234
+ |`text`|`t`|`wrap`<br>`nowrap`|-|`wrap`|✓|Text wrapping|
235
+ |`command`|`x`|_textdata_|✓|-|-|Device-specific commands|
236
+ |`comment`|`_`|_textdata_|✓|-|-|Comment|
237
+
238
+ ## Barcode options
239
+
240
+ Barcode options are separated by commas or one or more whitespaces.
241
+
242
+ |Barcode option|Description|
243
+ |---|---|
244
+ |`upc`|UPC-A, UPC-E<br>(Check digit can be omitted)|
245
+ |`ean`<br>`jan`|EAN-13, EAN-8<br>(Check digit can be omitted)|
246
+ |`code39`|CODE39|
247
+ |`itf`|Interleaved 2 of 5|
248
+ |`codabar`<br>`nw7`|Codabar (NW-7)|
249
+ |`code93`|CODE93|
250
+ |`code128`|CODE128|
251
+ |`2` - `4`|Barcode module width (px)|
252
+ |`24` - `240`|Barcode module height (px)|
253
+ |`hri`|With human readable interpretation|
254
+ |`nohri`|Without human readable interpretation|
255
+
256
+ ## 2D code options
257
+
258
+ 2D code options are separated by commas or one or more whitespaces.
259
+
260
+ |2D code option|Description|
261
+ |---|---|
262
+ |`qrcode`|QR Code|
263
+ |`3` - `8`|Cell size (px)|
264
+ |`l`<br>`m`<br>`q`<br>`h`|Error correction level|
265
+
266
+ ## Special characters in property values
267
+
268
+ Special characters in property values are different from special characters in text.
269
+
270
+ |Special character|Description|
271
+ |---|---|
272
+ |`\`|Character escape|
273
+ |<code>&#x7c;</code>|Column delimiter|
274
+ |`{`|Property delimiter (Start)|
275
+ |`}`|Property delimiter (End)|
276
+ |`:`|Key-value separator|
277
+ |`;`|Key-value delimiter|
278
+
279
+ ## Escape sequences in property values
280
+
281
+ Escape special characters.
282
+
283
+ |Escape sequence|Description|
284
+ |---|---|
285
+ |`\\`|&#x5c;|
286
+ |<code>&#x5c;&#x7c;</code>|&#x7c;|
287
+ |`\{`|&#x7b;|
288
+ |`\}`|&#x7d;|
289
+ |`\;`|&#x3b;|
290
+ |`\n`|New line|
291
+ |`\x`_nn_|Hexadecimal character code|
292
+ |`\`_char_ (Others)|Ignore|
293
+
294
+ # Why use this one over the reference implementation?
295
+
296
+ The original library has a weird hack to generate UUIDs on insecure contexts to get around a [currently debated WebCrypto standards detail](https://github.com/w3c/webcrypto/issues/408).
297
+ This prevented me from deploying to Cloudflare workers.
298
+ This fork and typescript adjustment is enough to unblock my objective.
299
+
300
+ I also wanted to use a diferent font.
301
+
302
+ # License
303
+
304
+ Apache 2 Licensed, per the [original source](https://github.com/receiptline/receiptline)
305
+
306
+ The word "QR Code" is registered trademark of DENSO WAVE INCORPORATED
307
+ http://www.denso-wave.com/qrcode/faqpatent-e.html
308
+
309
+ # Author
310
+
311
+ Open Foodservice System Consortium
312
+ http://www.ofsc.or.jp/
313
+
314
+ Levi Schuck
315
+ https://levischuck.com/