Bug? Drawing invalid characters with Barcode font

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Shazzner

Bug? Drawing invalid characters with Barcode font

Post by Shazzner »

Hi there, I'm using a barcode font and it draws standard characters fine however it gives me an invalid characters at the ends for this string: "šB-00015zœ"

I'm using this command: convert -font=Code128bWin.ttf -encoding=Unicode -draw=text 100,100 'šB-00015zœ' input.bmp output.bmp
Produces box-characters at the ends but barcode in the middle. I've tried other truetype fonts with the same results.

Any help on this? I'm using ImageMagickObject on Windows.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug? Drawing invalid characters with Barcode font

Post by anthony »

This would be a issue with the font not with IM, which is only using the font.

Barcodes I believe are simply numbers with a special start/end sequence.
That is all. so using š (s with two dots about it) is probably invalid and thus
the fonts 'invalid character' (a box) is displayed.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Shazzner

Re: Bug? Drawing invalid characters with Barcode font

Post by Shazzner »

anthony wrote:This would be a issue with the font not with IM, which is only using the font.

Barcodes I believe are simply numbers with a special start/end sequence.
That is all. so using š (s with two dots about it) is probably invalid and thus
the fonts 'invalid character' (a box) is displayed.
Hmmm I'm not so sure about that.

Barcodes have a start and end character, along with a checksum and the numbers. Sometimes the checksum becomes an invalid character when calculated.

Also as a test I c/p the text into Gimp with the barcode font and it showed up fine.

Edit: as another test I switched the font to a standard unicode font and I'm still getting the invalid characters. I suspect some kind of conversion is going on.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Bug? Drawing invalid characters with Barcode font

Post by fmw42 »

what version of IM and what version of GS are you using? Are they the latest?
Shazzner

Re: Bug? Drawing invalid characters with Barcode font

Post by Shazzner »

I'm using IM 6.5.4-Q16 and GS 8.64.

Should be the latest.
Shazzner

Re: Bug? Drawing invalid characters with Barcode font

Post by Shazzner »

Is there anyway to pass it in as hex?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Bug? Drawing invalid characters with Barcode font

Post by Bonzo »

I have just tried a couple of online barcode generator and I get:

http://www.barcoding.com/upc/
Error creating barcode.
A common problem is that the specified value can't be encoded with the selected format.
This one worked Ok;
http://www.idautomation.com/java/linearservlet.html

http://www.tec-it.com/online-demos/tbar ... px?LANG=en
Bar code generator error
Input contains unsuported characters
Some info: http://www.idautomation.com/code128faq.html

So Imagemagick is not the ony software that has problems.
Shazzner

Re: Bug? Drawing invalid characters with Barcode font

Post by Shazzner »

Hrm. I think I might just manually edit the font file...

E: Thanks for your help Bonzo and everyone.
Post Reply