Thursday, June 30, 2016

playing with code 128 font

I got a new barcode reader and so I thought why not test it. How hard is it to make a code128 barcode in LibreOffice? I found a code 128 font at OpenBarcodes and it's got a TTF file.

It has some VBA additions to work with MS Office, but I'm using LibreOffice.

So let's do it manually!

http://grandzebu.net/informatique/codbar-en/code128.htm

has all the information that we need.

I want to make it say "HELLO"

so let's put a Start B code in (which is code128 104 but maps to ASCII 209) in the font.

Insert Special Character 209

then HELLO (we'll do uppercase)

and computing the check digit is interesting, so I made a little spreadsheet to do that, and adjusting the ASCII codes by 32 characters. "H" is the check digit result.



Insert Special Character 211 for Stop

and it works! (After a bunch of trial and error mistakes - I think I did about 10 that didn't work)


No comments:

Post a Comment