bwipp / postscriptbarcode

Barcode Writer in Pure PostScript
https://bwipp.terryburton.co.uk
MIT License
463 stars 65 forks source link

code128 & codablockf: extended ASCII (FNC4) handling; code16k: raise error if no metrics match #210

Closed gitlost closed 2 years ago

gitlost commented 2 years ago

For code128, allow for an FNC4 immediately after a CodeC sequence, e.g. 50 100 moveto (^193^193^193^193^193^19399999999999999^193) (includetext parse) /code128 /uk.co.terryburton.bwipp findresource exec would fail. (This example due to @gredler of OpakiBarcode, [9ce6dcc].)

For codablockf, allow for FNC4 and possible shift when fitting in rows. so that they don't span, e.g. 50 100 moveto (aaa^223) (parse columns=4) /codablockf /uk.co.terryburton.bwipp findresource exec would decode as "aaa_" instead of "aaaß" as the FNC4 is fitted in the first row.

Also for codablockf, use original pre-FNC4 insertion message when calculating the K1 and K2 check characters.

For code16k, raise error if no metrics match data/options, e.g. 50 100 moveto (123456789012345678901234) (rows=2) /code16k /uk.co.terryburton.bwipp findresource exec.