[barcode] Circular barcode
Leonid A Broukhis
leob@mailcom.com
Tue Apr 6 19:20:16 CEST 2004
On Sun, Apr 04, 2004 at 11:00:57AM +0200, Alessandro Rubini wrote:
> > Is there any Postscript guru who can add that functionality
> > to GNU barcode?
>
> That would be fun, but the available time tends to zero. Besides,
> are there any specs about circular codes? I don't think it's as
I don't think so. The only program I could find does not mention any.
> simple as "any linear barcode but bended in a circle". And what
> are you using for reading it back? Or is it just a "nice to show around"
> feature?
Any barcode reader could be used for readback, as far as it is
positioned or moved radially. Every bar becomes a circle, like this
(the offsets and widths have to be corrected; as is, this circular
barcode is unreadable):
print "%!\n";
$xc = 300;
$yc = 300;
$r = 100;
# Usage: circode.pl space-bar-succession-from-GNU-barcode
@code = unpack ('C*', $ARGV[0]);
$space = 1;
foreach $i (@code) {
$i -= 48;
if ($space) {
$space = 0;
$r += $i;
next;
}
print $xc + $r, ' ', $yc, ' moveto ', $i-0.15, ' setlinewidth ';
print $xc, ' ', $yc, ' ', $r, " 0 360 arc stroke\n";
$space = 1;
$r += $i;
}
print "showpage\n";
Leo
More information about the barcode
mailing list