News for hackers. Stuff that matters.
Re:Libre Barcode Project by Closi on Tuesday December 22, 2020 @10:03AM (#25506849)
There seems to be a problem with code-128 where if you put multiple numbers in it doesn't work (e.g. 123456)
Re:Libre Barcode Project by ajennings on Tuesday December 22, 2020 @12:33PM (#25508825)
Code128 has a mandatory checksum, so I'm surprised they try to do it with a font.

Code39 is pretty common to convert into a font, since the checksum is optional.

Re:Libre Barcode Project by mark-r on Tuesday December 22, 2020 @10:24AM (#25507055)
Code 128 has a mode where it can encode 2 digits for every code. It's probably related to that somehow.
Re:Libre Barcode Project by mark-r on Tuesday December 22, 2020 @10:35AM (#25507216)
I just had a closer look and yes that's definitely the problem. Fonts require a 1:1 mapping between characters and outputs, there's no way to choose an output based on 2 consecutive digits so it needs to be mapped to an arbitrary character. If you scanned the resulting barcode I'm sure you'd see that it works just fine.
Re:Libre Barcode Project by ThePadawan on Tuesday December 22, 2020 @10:45AM (#25507369)
> Fonts require a 1:1 mapping between characters and outputs, there's no way to choose an output based on 2 consecutive digits

IIRC ligatures break this constraint - that's how coding fonts get fancy glyphs for "==", "===", "=>" and so on.

Re:Libre Barcode Project by mark-r on Tuesday December 22, 2020 @10:49AM (#25507430)
Good point, but that's probably too much work for a free font. Especially since you need to output a code to mode switch before you can use the 2-digit barcodes, the font won't have any way of knowing what mode you're in.
Re:Libre Barcode Project by ThePadawan on Tuesday December 22, 2020 @11:44AM (#25508184)
The free Fira Code [0] has them.

I don't have the knowledge to respond to your second point.

[0] https://github.com/tonsky/FiraCode