Closed leoherzog closed 5 years ago
For your information, I found out that the following are the start and stop characters : Ì and Î.
Thanks for the info!
If I have a string that's *0123456*
in Libre Barcode 39, it renders a scannable code.
If I do Ì0123456Î
in Libre Barcode 128, I haven't had any luck.
I guess I'll stick with 39 for the time being...
Sorry for responding slowly.
@xd1936 for code 128 you'll need a generator, because the encoding of that is not one to one what you type.
This one usually works for me: http://www.jtbarton.com/Barcodes/BarcodeStringBuilderExample.aspx
(but there are others as well) the result of 0123456
is Í!7MÈ6lÎ
from here: https://fonts.google.com/specimen/Libre+Barcode+128+Text
UPDATE: especially consecutive numbers are optimized in code 128, that's why the text-below in the example above is not really helpful.
Understood! How would I find more information on the algorithm that converts a string to properly encoded text? I'm looking to implement this in Javascript in a project.
@graphicore yea it'd be super useful to have an open source implementation of an encoder that works for this font.
There's zero documentation anywhere about it and your links no longer work.
Agreed. There's documentation at Wikipededia: https://en.wikipedia.org/wiki/Code_128 (see Barcode length optimization. What we need is a good dynamic algorithm to find the shortest encoding.
Here's a working online encoder: https://www.bcgen.com/fontencoder/
Still trying to understand Code128 myself but I have what I think is a working, rudimentary Powershell implementation here. No digit optimization yet, but if I understand correctly, it just encodes double digits as a single value with Code C, so you'd need a lookahead to detect double digits. Shouldn't be difficult to convert to Python/Javascript if anyone wants to.
I'm implementing an optimizing encoder now, will be in JavaScript and online soon.
This is all terrific. How can I access the encoder in my php / java apps?
This is a great project, keep up the good work!
If I was to use the Libre Barcode 128 font in my web project, there is no documentation anywhere as to how to generate a code128 checksum, convert a string to code128, or what the start/stop characters are in your font. Please consider adding some documentation to this project's
README
, because simply applying your font to a span of text will not render a scannable barcode. Thanks!