[Barcode] Some questions about barcode-0.95

Alessandro Rubini rubini@gnu.org
Fri, 1 Mar 2002 18:43:31 +0100


Hello.

This is about a question of 1.33 years ago.

>> > *) The generated PS-code uses absolut values for positioning. Why not
>> > use normalized values and scale in x/y-direction?
>> 
>> Sorry, I didn't understand.
> 
> The question was not clear, sorry. I show by example what I ment:

[ explanation removed]

Actually, in ps.c I remove a small fraction of the width of the bars
to accound for ink spreading. Obviously ink spreading depends on the
specific properties of the ink and paper used, but I've found that the
chosen value works acceptably (at least better than no adjustment at
all). Nobody reported problems becuase of ink spreading management.

>  0.44 setlinewidth  10.29  12.95 moveto 0 53.05 rlineto stroke
>  0.44 setlinewidth  12.65  12.95 moveto 0 53.05 rlineto stroke
>  1.62 setlinewidth  14.42  12.95 moveto 0 53.05 rlineto stroke
>  1.62 setlinewidth  16.78  12.95 moveto 0 53.05 rlineto stroke

Yes, you are right, this is horrible. Actually, I've already
switched to a better approach (factorizing the command, outputting
only an array of numbers).

> [...]

> Here are my theoretical suggestions for PS-code based on the
> bar/space comment-line:
> 
> *) bars should not be drawn using setlinewith, but by drawing
> rectangles of defined width (wide or narrow) and hight of 1

There's no actual difference between lines and rectangles.
However, since a barcode symbol may include a text part,
scaling the whole symbol is not easy to get right.

> *) spaces should be drawn like bars.
> *) both should be drawn following the comment-line-string

That would be good, but you still should account for ink spreading,
and I just didn't want to tinker too much with postscript code.
 
> I am shure it's horrible prototype PS-code, please look at the sense
> :-)

It's much better than what you quoted above. When I wrote that stuff
I didn't know the most basic postscript concepts.

> Please don't take my comment to serious :-)

Well, I did. Only a little too late.

> It's just what comes to my mind dealing the first time with barcodes
> and being a great fan of GNU-software (and Linux) for years.

That's good :)

Thanks for your comments.
/alessandro