5 ms·
When I've had to work with barcodes I found it easy enough to generate an image rather than using a font. Font mapping for things that aren't characters, like
by mark-r 6y ago
When I've had to work with barcodes I found it easy enough to generate an image rather than using a font. Font mapping for things that aren't characters, like stop codes, is always a tricky business.
- mrweasel 6y agoI found the opposite to be true. Yes, generating the image isn't that complicated, but getting them to scale correctly so that your label printer will produce a printed barcode that will both fit on the label and be readable by a barcode reader is a nightmare. Having to scale a font seem to be much easier to deal with, but I might be wrong.
- colejohnson66 6y agoAssuming you’re talking about blurring due to raster images, wouldn’t vector images solve that? A font is (generally) just that: vectors, not pixels.
- mrweasel 6y agoNo, not blurring, you can only "stretch" a barcode so far, before the spacing confuses the scanner. The issue we faced was a bit stupid and a result of trying to save money. The type of barcode we used, and I forget the type, was actually a little to large for the labels we wanted to use, and the labels where very skinny. Trying to maximize the size of the barcode, so our cheap scanner would read the, meant pushing the barcode almost to the edge of the label. That involved fiddling with the size and margins on the Zebra printers, and if you don't get it right the scanner would either fail to read the barcode because the margin was to small (at least our cheap scanners require a margin of some minimal size to identify where the bars start) or the lines where to short and scanners can't read the bars if they're to short.
- mark-r 6y agoThe barcode standards themselves specify the amount of white space you need before and after the barcode proper. Even the cheapest scanners should work if you met that.
- mark-r 6y agoI made the bar widths configurable in the functions I wrote. If you know the DPI of your printer and how big you want your barcode to print, it's simple division to get that figure. I printed both to laser printers and Zebra label printers.
- kevin_thibedeau 6y agoYou generate a vector image and it works like a scalable font.
- caeril 6y agoAll standard label printer formats (EPL2, ZPL, etc) support barcodes directly, and have for decades.
- semireg 6y agoI’m a solo developer that built and maintains https://label.live https://label.live, a label design and print app (Electron) that has the ability to generate barcodes thanks to the open source project BWIP-JS (and all the turtles beneath it). My app renders canvas data down to 1-bit images and sends them off to the printer as raster images. Each printer handles image data a bit differently. Although Zebra printers do support in-printer-barcodes (put a barcode of type Z at x,y) I opted to send full-sized images for every label and lose efficiency for greater reproducibility. I also support DYMO and BROTHER thermal printers that do not have built in barcode support. One of the things that people don’t think about (ie my loving users) is how a minimally sized barcode doubles in size due to DPI. If your barcode has narrow bars equaling one dot width, then your next choice larger is literally 2x the size. There is no gray in thermal printers, just black or white. And on the flip side, barcode scanners need the highest contrast to scan. Where people get in trouble is pixel misalignment, thinking that you can scale a tiny barcode by 20% at 200 DPI. Nope, sorry dear user! The last few years have been a ton of fun. I really enjoy HN posts about barcodes. It makes me feel relevant. Ha!
- jpitz 6y agoEspecially for code 128C. I wrote a little image generator back in 2001-ish in the space of a few hours - the hardest part was just writing out the symbol table.