@@ -108,7 +108,7 @@ Each resource source file has a similar structure:
108108
109109Encoder source files contain metadata comments:
110110
111- ```
111+ ``` postscript
112112% --BEGIN ENCODER encodername--
113113% --EXAM: example input data
114114% --EXOP: example options
@@ -123,7 +123,7 @@ assemble the resource as a prolog; listen in order of inclusion
123123
124124### Lazy Initialisation Pattern
125125
126- ```
126+ ``` postscript
127127/resource.latevars dup 16 dict def load /init {
128128 currentglobal
129129 true setglobal % Lazy vars must be in global VM, like resource definitions
@@ -163,13 +163,13 @@ assemble the resource as a prolog; listen in order of inclusion
163163
164164Resources are registered to the ` /uk.co.terryburton.bwipp ` category:
165165
166- ```
166+ ``` postscript
167167/encodername dup load /uk.co.terryburton.bwipp defineresource pop
168168```
169169
170170Dependencies are loaded at the start of the resource definition:
171171
172- ```
172+ ``` postscript
173173N dict
174174dup /raiseerror dup /uk.co.terryburton.bwipp findresource put
175175dup /parseinput dup /uk.co.terryburton.bwipp findresource put
181181
182182### Main Procedure Structure
183183
184- ```
184+ ``` postscript
185185/encoder {
186186 20 dict begin
187187
@@ -239,7 +239,7 @@ bind def
239239
240240## User API
241241
242- ```
242+ ``` postscript
243243<barcode data string> <options string or dict> /<encoder> /uk.co.terryburton.bwipp findresource exec
244244```
245245
@@ -357,14 +357,14 @@ Encoders create a common dictionary structure expected by their renderer:
357357
358358Success test - validate 1D barcode graphical structure via sbs array:
359359
360- ```
360+ ``` postscript
361361(INPUT) (dontdraw) encoder /sbs get
362362[1 2 1 1 ...] debugIsEqual
363363```
364364
365365Success test - validate 2D barcode graphical structure via pixs array:
366366
367- ```
367+ ``` postscript
368368(INPUT) (dontdraw) encoder /pixs get
369369[
370370 1 0 1 0 ... % Aligned to shape of 2D bitmap
@@ -374,21 +374,21 @@ Success test - validate 2D barcode graphical structure via pixs array:
374374
375375Success test - validate encoder codeword output:
376376
377- ```
377+ ``` postscript
378378{
379379 (TESTING) (debugcws) encoder
380380} [32 61 39 ...] debugIsEqual
381381```
382382
383383Error test:
384384
385- ```
385+ ``` postscript
386386{ (INPUT) (dontdraw) encoder } /bwipp.encoderErrorName isError
387387```
388388
389389For repetitive tests, use template procedures:
390390
391- ```
391+ ``` postscript
392392/eq_tmpl {
393393 exch { 0 (dontdraw) encoder /sbs get } dup 3 -1 roll 0 exch put
394394 exch isEqual
@@ -398,7 +398,7 @@ For repetitive tests, use template procedures:
398398(87654321) [1 2 1 1 1 ...] eq_tmpl
399399```
400400
401- ```
401+ ``` postscript
402402/eq_tmpl {
403403 3 1 roll { 0 0 encoder /pixs get }
404404 dup 3 -1 roll 1 exch put % insert options
@@ -409,7 +409,7 @@ For repetitive tests, use template procedures:
409409(DATA) (eclevel=M) [...pixs...] eq_tmpl
410410```
411411
412- ```
412+ ``` postscript
413413/er_tmpl {
414414 exch { 0 (dontdraw) encoder } dup 3 -1 roll 0 exch put
415415 exch isError
0 commit comments